Redirects not working
2 posts
• Page 1 of 1
- Typhoon101
- Posts: 1
- Joined: 05 May 2015, 13:04
Redirects not working
Hi. I have been tasked with creating a couple of vanity URLs for our website. However, I cannot seem to get them to work. An example of a URL we require is http://www.domain.com/uk/product which should redirect to something like /uk/dir1/dir2/dir3/index.htm. The rule I am trying (amongst other working rules) is
RewriteBase /
RewriteRule ^(?:/)?uk/product(.*)? /uk/dir1/dir2/dir3/index.htm [NC,R=301,L]
Am I doing something wrong?
I should probably add that if my rule is only one directory deep (I.e. ^(?:/)?product(.*)?), the redirect works. It only fails when trying to match something deeper than the root level.
Thanks.
RewriteBase /
RewriteRule ^(?:/)?uk/product(.*)? /uk/dir1/dir2/dir3/index.htm [NC,R=301,L]
Am I doing something wrong?
I should probably add that if my rule is only one directory deep (I.e. ^(?:/)?product(.*)?), the redirect works. It only fails when trying to match something deeper than the root level.
Thanks.
Re: Redirects not working
Hello,
Please clarify where your .htaccess is located - in the siteroot?
Put the following in the siteroot .htaccess:
RewriteBase /
RewriteRule ^uk/product /uk/dir1/dir2/dir3/index.htm [NC,R=301,L]
If it doesn't work, please enable logging and provide rewrite.log records for the test request.
Please clarify where your .htaccess is located - in the siteroot?
Put the following in the siteroot .htaccess:
RewriteBase /
RewriteRule ^uk/product /uk/dir1/dir2/dir3/index.htm [NC,R=301,L]
If it doesn't work, please enable logging and provide rewrite.log records for the test request.
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 26 guests