0

Another developer wrote these rules rules:

[ISAPI_Rewrite]
RewriteCond Host: (?:.+\.)?mydomain\.com
RewriteCond URL ^/mydomain.com/(.*)
RewriteCond METHOD GET
RewriteRule ^/mydomain.com/(.*) /$1 [I,R]
RewriteCond Host: (?:.+\.)?mydomain\.com
RewriteCond METHOD POST
RewriteRule ^/mydomain.com/(.*) /$1 [I]
RewriteCond Host: (?:.+\.)?mydomain\.com
RewriteRule (.*) /mydomain.com/$1 [I,L]

The problem is I'm not sure if those lines are the ones causing the site to redirect to the http://www.mydomain.com whenever we try accessing http://www.mydomain.com/shop. I am also concerned if those lines have an impact on SEO. BTW, the site is running on IIS and not Apache.

Any help would be very much appreciated. Thanks.

Jhourlad Estrella
  • 3,545
  • 4
  • 37
  • 66
  • The question is when you type in "mydomain.com/shop", you're being redirected to "mydomain.com/" ? – kermit Oct 12 '13 at 03:10
  • @kermit: Yes, that is correct. I am editing my question now. – Jhourlad Estrella Oct 12 '13 at 03:16
  • First thing I would do is turn on logging and see what's going on there: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritelog - and set the log level high. See what that information yields. If any of these rules match it seems like they should be appending some or all of the incoming URL to mydomain.com/[some|all]incoming url. So it may be possible the behavior is not related to this. I'd investigate what the [I] flag means. – kermit Oct 12 '13 at 14:11
  • Logging won't work since it's ISAPI_Rewrite2. The problem is caused by the very last rule. Try to comment it out by adding '#' and see what happens. SInce you can identify the rule by commenting it out and testing. My question would be - what do you want to do next? Alternate the rule? In which way? – Andrew Oct 14 '13 at 13:13

0 Answers0