Redirecting to another site for certain requests within Umbraco
Hi All,
I'm trying to separate two sites, one that has existed as a virtual directory of the main one for some time now. I'd like to give it it's own domain name now. Having said that, a number of users (and links within documents) will still point to the old site.
Current structure:
www.mysite.com/virtualapp
What I want:
www.mysite.com www.newapp.com
I'm trying to swing this so that a user requesting something like:
www.mysite.com/virtualapp/some/document.pdf
Will be redirected to:
www.newapp.com/some/document.pdf
However, I'm having trouble working out what to put in /config/urlrewriting.config
The free version let me specify rules at the server level (the limitation is that it doesn't let you specify rules at the site level) and has a GUI to use. Easy to setup and get working. Here's an example of the rewriting rules if anyone else should ever need it:
RewriteEngine on RewriteBase /
RewriteCond %{HTTPS} off RewriteCond %{HTTP:Host} ^(?:www\.)?.+?mysite\.com$ RewriteRule ^virtualapp(.+)? http://newapp.mysite.com/$1 [R,L]
RewriteCond %{HTTPS} on RewriteCond %{HTTP:Host} ^(?:www\.)?.+?mysite\.com$ RewriteRule ^virtualapp(.+)? https://newapp.mysite.com/$1 [R,L]
Two rules. Each has a rewrite condition to make sure it's only applied against mysite.com and one is only applied to HTTP and one to HTTPS. The rewrite rule just grabs everything originally requested after virtualapp and applies it to newapp.mysite.com.
Redirecting to another site for certain requests within Umbraco
Hi All,
I'm trying to separate two sites, one that has existed as a virtual directory of the main one for some time now. I'd like to give it it's own domain name now. Having said that, a number of users (and links within documents) will still point to the old site.
Current structure:
www.mysite.com/virtualapp
What I want:
www.mysite.com
www.newapp.com
I'm trying to swing this so that a user requesting something like:
www.mysite.com/virtualapp/some/document.pdf
Will be redirected to:
www.newapp.com/some/document.pdf
However, I'm having trouble working out what to put in /config/urlrewriting.config
Is this possible to do?
Thanks,
Jay
Hy All,
I wanted to follow-up. I found an ISAPI filter that does the trick:
http://www.helicontech.com/isapi_rewrite/
The free version let me specify rules at the server level (the limitation is that it doesn't let you specify rules at the site level) and has a GUI to use. Easy to setup and get working. Here's an example of the rewriting rules if anyone else should ever need it:
Two rules. Each has a rewrite condition to make sure it's only applied against mysite.com and one is only applied to HTTP and one to HTTPS. The rewrite rule just grabs everything originally requested after virtualapp and applies it to newapp.mysite.com.
mysite.com/virtualapp/pdf/whatever.pdf becomes newapp.mysite.com/pdf/whatever.pdf
So far I think it's all working.
Thanks,
Jay
is working on a reply...