Questions tagged [redirect]

"HTTP Redirection" – the process by which a request for one URL is automatically replaced by a request for a different, usually related, URL.

Filter by
Sorted by
Tagged with
4
votes
1answer
6k views

Subdomains to pages

Hi I have a website on wordpress which have 2 pages which I meant to convert it to subdomain. Eg: Let my website at be http://www.domain.com there are two pages http://www.domain.com/page1 and ...
2
votes
1answer
7k views

Wordpress redirect loop on nginx + apache reverse proxy

I am trying to setup a fresh Wordpress installation on an nginx + apache reverse proxy configuration. My installation process was as follows: Installed nginx and apache servers Configured nginx (conf ...
1
vote
6answers
25k views

Redirect loop (only for multisite network admin)

I can log into http://localhost/wp/wp-admin/ fine, but logging into http://localhost/wp/wp-admin/network/ produces a network redirect loop (ERR_TOO_MANY_REDIRECTS). The site also loads just fine even ...
9
votes
1answer
15k views

Login redirect to previous page

I have a custom login page at http://netballscoop.com/log-in/ When you fill the username and password it redirects you to the previous page you were on perfectly. When you click Log Out it redirects ...
8
votes
3answers
9k views

How do I programmatically generate a 404?

How can I get something like this to work? // in a plugin / theme: // This imaginary function will make WordPress think that the // current request is a 404. // Ideally this function could be ran ...
6
votes
4answers
14k views

How to change the default logout link on WordPress Admin

I want to use another link for logout because I have /wp-admin/* protected with htpassword. Is there a way to do this? Something like creating a custom page like site.com/logout then use it as my new ...
4
votes
0answers
651 views

How do I rename the wp-admin folder with the admin_url filter? [duplicate]

Possible Duplicate: Can I rename the wp-admin folder? I have applied some mod_rewrite rules to redirect /wp-admin to /my-admin - based on this tutorial. I also changed the admin url internally ...
4
votes
2answers
6k views

How do I turn off 301 redirecting posts (not canonical)?

I noticed a strange behavior in WordPress where it automatically 301 redirects certain URL structures for posts. For example, I have a post entry for: mysite.com/999/about-us Then, you would think ...
4
votes
2answers
2k views

Preventing index.php?category_name=something from redirecting

I'm trying to filter posts in a category by the year of the post's date. I also want to do this without being redirected to the year template so my ideal URL would be http://example.com/category/...
3
votes
1answer
4k views

How to hide/redirect the author page

I have a website where I let people subscribe. I would like to only show the author page for actual authors who have written a post. I wrote this code that checks for post the problem is I can't use a ...
2
votes
3answers
8k views

How do I redirect all 404 errors of a specific post type to another URL?

I have a custom post type containing job listings, that is highly volatile. Jobs are frequently added and removed. Our analytics show that a lot of crawling errors are for detail pages of jobs that ...
2
votes
4answers
9k views

Redirect to custom URL after registering from a page with registration form

I have this form in a page template <form action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" method="post"> <div class="formrow requiredRow"><label ...
1
vote
1answer
726 views

htaccess or redirect to cloak portion of a link?

I have an ad rotate plugin installed to display a few ads on my site but the plugin is coded so that it uses the full directory in the ad count link. I would like to know if there's something easy to ...
1
vote
1answer
3k views

Insert code when users come from an specific referer

Let me elaborate, because I think this is a pretty strange question. I want to be able to add some code to my post when a user comes from an specific referrer and arrives to an specific URL. This ...
1
vote
3answers
3k views

Redirecting user after updating profile?

I have been working around with adding stuff in user profile edit area. I am done with that but there is one thing I am unable to sort out. What I am planning to do is to redirect a user to a custom ...
0
votes
3answers
2k views

Multisite wp-admin redirect loop

I have a subdirectory multisite setup, it all works fine apart from one small issue... The sites are setup in the following structure: http://domain.com/blogs/ http://domain.com/blogs/second/ http://...
5
votes
2answers
7k views

How to configure nginx to redirect requests to the uploads directory to the production server?

I'm just getting my feet wet with nginx. In the past I've used an .htaccess file in /wp-content/uploads so if my dev or staging server doesn't have the file it redirects to the production server: <...
5
votes
1answer
7k views

add_rewrite_rule: $matches var not replaced by captured value

I want to access a plugin file (when <a> is clicked) without exposing actual path of the file. I am using the following rewrite rule: add_rewrite_rule( 'continue/([0-9]+)/?$', 'wp-content/...
4
votes
4answers
9k views

PHP - redirect https to http and www to non-www

**EDIT: I finally figured this out. Scroll down for my self-answered self-accepted answer (green check mark) ** I'm currently using functions.php to redirect https urls to http for a site which ...
3
votes
1answer
520 views

Authentication / login mechanism (non wp-admin)

I am developing a theme. I need to have a user login system, that allows users to see all contents of the application and interact with it only after they login (not admin panel login). I need to ...
3
votes
1answer
2k views

Htaccess redirect from '/%postname%.html' to '/%postname%'

I have a Drupal 5.x based travel review site which I'm moving over to Wordpress 3.x (same domain name). The Drupal site is structured like this: www.example.com/travel-guides (these are top-level ...
3
votes
1answer
4k views

How do I add a add_rewrite_rule without it redirecting?

I have a custom post type called "locations". I have a location called "starbucks". I can view this by going to "/location/starbucks". I would like to add "coffee-shop" to the URL, so the path "/...
3
votes
1answer
3k views

Permalink redirection from 'Day and name' to 'Post name'

In my blog, I used the Day and name permalink structure for many days. Recently I came to know the SEO tips and made the permalink structure to Post name. So I migrated from: http://nishachor.com/%...
3
votes
2answers
299 views

Correct way to hide pseudo pages from being shown?

The homepage on a site we've developed has four pieces of content: the parent page and three further "pages" of text which we bring into the parent page using PHP. Call them Foo, Bar1, Bar2, Bar3 if ...
2
votes
2answers
11k views

Domain redirect in Wordpress multisite

I have two domains www.domain1.com and www.domain2.com, both pointing to the same host. What I want to do is redirect www.domain2.com to www.domain1.com/domain2. I got this code for a .htaccess from ...
2
votes
2answers
1k views

How to let a single post have its own domain name

I am not sure which solution here would work best as a solution but what I am looking for is just a simple way to enter an optional domain through a metabox on the page edit screen and then just ...
2
votes
5answers
11k views

Multisite non-www domain redirects to sign-up

I have Multisite enabled and can only view my site with the www. When I try without the www it sends me to the sign-up page and says Registration has been disabled. www.domain.com/portfolio <--...
2
votes
2answers
9k views

Wordpress Redirect based on the prescence of a cookie

I have a tricky situation.... I'd like to check for a cookie. If it doesn't exist then then redirect to an internal wordpress page, and set a cookie. And then carry on browsing the site. But i get ...
2
votes
1answer
5k views

Wordpress network (multisite) /wp-admin/ redirect loop (ERR_TOO_MANY_REDIRECTS)

I have a Wordpress network where I run +/- 10 sites. Recently, I got a redirect error when accessing the wp-admin page for one of the sites. All sites in the network are working fine, I can also ...
1
vote
1answer
2k views

Multisite - Redirect All Users to Subsite Home Page on Subsite Login

I have a WordPress multisite network and would like to redirect all users who log into a subsite to the subsite's home page. I have found many plugins and functions.php code that redirect to the ...
1
vote
1answer
2k views

Facebook like button that redirects?

Basically, here is an idea: I am starting a daily blog, and in order to gain access to sunday's posts, the user needs to share the site. I have figured out how to redirect once someone presses the +1 ...
1
vote
2answers
6k views

wp-login.php — redirect logged in users to custom URL

When a user login, we can easily change the redirect URL (see this, this, or this), but if the user goes to /wp-login.php, they will be redirected to the dashboard if they are already logged in. My ...
1
vote
1answer
248 views

Is Auto Post recognition a WordPress feature? How to turn it off?

I noticed that if you go to lostlettermen.com/aa, it redirects to a post. Is this a feature in WordPress that can be turned off, or is this done by some type of plugin or custom code?
1
vote
1answer
97 views

Redirect short-form URL to long-form URL (post_id to post_id + post_name)

My blog uses this custom structure for permalinks: /%post_id%/%postname%/ e.g.: https://bilingueanglais.com/blog/1/combien-d-heures-faut-il-pour-apprendre-l-anglais/ Articles can then be ...
1
vote
1answer
851 views

Using redirection plugin to pass URLs as lowercase to wordpress

have been experiencing a problem yesterday. My site is in Hebrew language. MY site is built on Wordpress. The problem is related to escaped encoded posts URL only. IF the post URL has escaped encode ...
1
vote
1answer
5k views

Redirect users after first login

I want to redirect my users to a page after they logged in for the first time. I also noticed some solutions like a redirect after the user was registered (redirect after first 48 hours) but the ...
1
vote
2answers
1k views

How are both HTTP and HTTPS versions displaying?

We have a site that somehow has both http and https versions accessible. We want to force it all to https. When we try to set the WordPress and Site URLS to https the site ends up in a redirect loop. ...
0
votes
4answers
2k views

Multisite non www domain gives registration error but should redirect to www.domain.com

I'm running wordpress multisite, and when I connect to my domain at domain.com I get the error "Greetings Site Administrator! You are currently allowing “none” registrations. To change or disable ...
0
votes
1answer
268 views

Custom domain for sub-section of parent website

While this topic could be considered a general web development item, I'm using WordPress, so I need to find some way to do this within WordPress and without breaking it. I realize this is a deep ...
0
votes
1answer
260 views

Create additional short URL with custom field and 301 redirect

I want to create an additional shorter Version of my Post-Permalink with a 301 redirect to the real post URL. The shorter Version of the URL should get its Custom Field I added as a post meta. It is ...
0
votes
2answers
5k views

Detecting $_GET parameters from any page + Cookie

I'm trying to create a basic affiliation system plugin that for now, will do the following: If it exists, read a $_GET URL parameter in any page (for instance http://mysite.com/about/?affid=1234). If ...
0
votes
1answer
3k views

Redirecting to home-page when saving any edited code

Whenever I edit any theme code in my Dashboard -> Appearance -> Editor and try to save it, the file is not saved and it automatically redirects me to the homepage. I don't know why is this happening. ...
0
votes
1answer
562 views

Auto 301 to full post permalink? (using /posts/%post_id%/%postname%)

I update my permalink structure to /post/%post_id%/%postname%, but if someone uses a URL like /post/1234 instead of the full URL of /post/1234/bingo-rulz, WordPress shows the post without giving a 301 ...
0
votes
2answers
2k views

Redirect Tag to Post with the same name

I would like to check if the tag name is the title of a post. And load that post page instead of a tag page. I have post_type "Cities" and suppose that users will tag normal posts with city names. ...
0
votes
0answers
126 views

Problem to redirect custom page using htaccess

I could not create dynamic post through URL by .htaccess, Page or Post redirect automatically 404 page. I have tried Redirection Plugin, but i could not successfully redirect. Please try to give ...
0
votes
1answer
1k views

301 Redirects for posts, category, pages from original domain to sub-domain of multisite

I want to move my blog from its original domain (site1.com) to become a sub-domain on another domain which is a multisite installation (sub1.site2.com). I also want to change the permalink structure ...
0
votes
1answer
567 views

Prevent redirect to page/page when reserved term 'name' in $_POST when value is a page/post title

I'm using a particular payment gateway which includes in their payment response the parameter 'name'. I'm aware this is a reserved term which shouldn't be used. Unfortunately, I have no control over ...
8
votes
2answers
4k views

Why is wp_redirect() preferable to a standard PHP header redirect?

In asking a question about hooks and redirects, I was advised to use wp_redirect in place of the PHP header function. Just wondering why wp_redirect is preferable?
5
votes
3answers
4k views

Stop WordPress and Plugins from Overwriting .htaccess

How can I prevent WordPress and plugins from overwriting my .htaccess file? I use Wordpress to set the structure of my permalinks; so I doubt it is practical to deny all permissions to the file. If ...
3
votes
2answers
26k views

Redirection Plugin: Redirect all URLs with a regular expression

I understand little about regular expressions, but I need to figure one out to use with the Redirection plugin which supports redirects with regular expressions. http://urbangiraffe.com/plugins/...