Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

301 Redirects Issue with Sub Pages

7:15 pm on Jan 12, 2013 (gmt 0)

10+ Year Member


I'm having a lot of trouble getting 301 redirects to work for a site update. It's very odd. I'm hoping someone here might have the answer.

Many of the 301's work just fine. The problem is with old pages that are sub-pages of a parent. For example I might have something like this:

Redirect 301 /cars/ [mydomain.com...]
Redirect 301 /cars/ford/ [mydomain.com...]
Redirect 301 /cars/lexus/ [mydomain.com...]

It fails to redirect. I have tried removing the '/' from the first one as I thought it was treating it as a folder and affecting all the following redirects. That didn't work.

I've spent hours on this and can't seem to find an answer for the correct syntax when sub-pages are involved. The above are all individual pages and I'd like each treating separately and not to affect subsequent 301s.

BTW, this is for a WordPress site - if that makes a difference. The only other thing in the .htaccess other than the many redirects is the following:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

Anyone know how to handle sub-pages?
9:26 pm on Jan 12, 2013 (gmt 0)

10+ Year Member

I still don't know what went wrong here, but I think it may be a conflict with a WP plugin. I've done a workaround and just 301'd the incorrect redirects. Not exactly ideal, but it works.
9:39 pm on Jan 12, 2013 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

Do not use Redirect or RedirectMatch.

Use only RewriteRule and place the new rules before the wordpress code.

Use example.com in code examples to suppress URL auto-linking.