I'm trying to use ManagedFusion UrlRewriter module on my main/root web site to redirect requests with a certain host name to a sub-folder of the root. Let's say my root is called profkroot.com
, and it has a sub-folder (ASP.NET application) called cottages
. I also have a domain called profkcottages.com
, which I'm trying to redirect to profkroot.com/cottages
.
Using the following example rule, I get a totally borked rewritten URL. I grok the regex side of the rule, but I don't know enough about the rewrite part, and this is getting kind of urgent, so any help will be appreciated.
Here is the rule in place on profkroot.com
:
RewriteEngine On
#Fix missing trailing slash char on folders
RewriteCond %{HTTP:Host} (.*)
RewriteRule ([^.?]+[^.?/]) http\://%1$1/ [R]
#Emulate profkcottages.com
RewriteCond %{HTTP:Host} (?:www\.)?profkcottages\.com
RewriteRule (.*) /cottages$1 [NC,L]
Here is the rewritten url if I request http://profcottages/home.aspx
:
http://profkcottages.com/http/://profkcottages.com/home/.http/://profkcottages.comaspx/