Redirects not working

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 1
Joined: 05 May 2015, 13:04

Redirects not working

05 May 2015, 13:15

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.

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Redirects not working

07 May 2015, 09:40

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.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 26 guests