Website root not correct after redirect

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 4
Joined: 03 Oct 2013, 11:38

Website root not correct after redirect

19 Nov 2013, 11:41

I have the following issue where I'm doing an extensionless url scenario from an old site that was asp to a new site that is aspx. The old site did not use extensionless urls, but the new site does. Also, I tested this and had it working through a subdomain but since launching on the main domain something isn't right....

So if I go to the old domain of example.com/industries/sports-events.asp my new url would be example.com/industries/sports-events/

So I have the rule....

RewriteRule ^/Industries/Sports-Events\.asp?$ industries/sports-events/ [NC,R=301]
RewriteRule ^/industries/sports-events?$ /industries/sports-events.aspx [NC]


RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^example.com$
RewriteProxy ^(.*)$ http\://192.x.x.x/site$1 [NC,U,L,K,H]


IP address is purposefully obscured as is the sitedir.

But the issue is that when my site loads it thinks the site root is example.com/industries/ not example.com
This is a problem since my css and js and imgs directories are at the site root. Is there a certain flag or rule that could be causing the redirect to make it look like the site root is now /industries/ intead to my .aspx application?

I put this out here since there is a chance it might not be a rewrite issue, although as I said before this wasn't a problem before when I had it on a subdomain for testing.

User avatar
Posts: 4
Joined: 03 Oct 2013, 11:38

Re: Website root not correct after redirect

19 Nov 2013, 16:23

I figured it out. When the url ended in a / asp.net wanted to handle it like a directory and the ResolveClientUrl though that the /industries/ was now the webroot. Made a rule to remove all trailing / from urls and it works great.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 16 guests