Rule works on Apache, not on IIS with ISAPI_Rewrite 3
2 posts
• Page 1 of 1
Rule works on Apache, not on IIS with ISAPI_Rewrite 3
Hi,
The rule below works as expected on Apache 2.
It redirects a request that ends with "/shop/" to "/shop/Overview",
EXCEPT if the URL ends with "/sites/shop/".
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^(.*)/shop/?$ [NC]
RewriteCond %{REQUEST_URI} !^.*/sites/shop/?$ [NC] # Do not apply to sites/shop
RewriteRule . http://%{HTTP_HOST}%1/shop/Overview [R=301,L]
The URL we are testing with is this:
http://example.com/sites/shop/
It redirects to the URL below which is the wrong behaviour:
http://example.com/shop/overview
Why is it not working ?
We are using ISAPI_Rewrite 3.1.0.112.
- Thanks in advance
Best regards
Jimmy
The rule below works as expected on Apache 2.
It redirects a request that ends with "/shop/" to "/shop/Overview",
EXCEPT if the URL ends with "/sites/shop/".
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^(.*)/shop/?$ [NC]
RewriteCond %{REQUEST_URI} !^.*/sites/shop/?$ [NC] # Do not apply to sites/shop
RewriteRule . http://%{HTTP_HOST}%1/shop/Overview [R=301,L]
The URL we are testing with is this:
http://example.com/sites/shop/
It redirects to the URL below which is the wrong behaviour:
http://example.com/shop/overview
Why is it not working ?
We are using ISAPI_Rewrite 3.1.0.112.
- Thanks in advance
Best regards
Jimmy
Re: Rule works on Apache, not on IIS with ISAPI_Rewrite 3
It turned out that ISAPI_Rewrite does not remove comments before interpreting the rules,
so the "# Do not apply to sites/shop" portion broke the expression.
Developers: Please consider changing this behaviour for maximum Apache compatibility.
Thanks.
so the "# Do not apply to sites/shop" portion broke the expression.
Developers: Please consider changing this behaviour for maximum Apache compatibility.
Thanks.
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 21 guests