Domain extension rewrite

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 1
Joined: 04 Apr 2014, 17:30

Domain extension rewrite

04 Apr 2014, 17:54

I am a 'newbie' and I am trying to get a ISAPI_Rewrite script that someone else wrote to work correctly. It couurently looks like this:

[ISAPI_Rewrite]
### subdomain redirect v2 ###
RewriteCond Host: (?:.+\.)?softree\.ca
RewriteCond URL ^/softree.ca-redirect/(.*)
RewriteCond METHOD GET
RewriteRule ^/softree.ca-redirect/(.*) /$1 [I,R]

RewriteCond Host: (?:.+\.)?softree\.ca
RewriteCond METHOD POST
RewriteRule ^/softree.ca-redirect/(.*) /$1 [I]
RewriteCond Host: (?:.+\.)?softree\.ca
RewriteRule (.*) /softree.ca-redirect/$1 [I,L]

It works i.e. http://www.softree.ca --> http://www.softree.com but individual pages don't work
i.e. http://www.softree.ca/Products/Products.aspx doesn't map to http://www.softree.com/Products/Products.aspx

Any help or suggestions would be greatly appreciated.

Craig Speirs

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

Re: Domain extension rewrite

07 Apr 2014, 05:53

Hello,

First, please clarify if it's v2 or v3 that you use. Because the syntax looks like v2 but you posted the question in v3 forum.
Generally, in v2 what you want can be achieved as follows:

ISAPI_Rewrite]
### subdomain redirect v2 ###
RewriteCond Host: (?:.+\.)?softree\.ca
RewriteCond METHOD GET
RewriteRule (.*) http://www.softree.com$1 [I,P]

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 0 guests