Help w/rewrite from old web to new with exception
5 posts
• Page 1 of 1
- edcartagena
-
- Posts: 3
- Joined: 25 Apr 2013, 15:46
Help w/rewrite from old web to new with exception
Situation:
I have a website fh.floridahospital.com that I want users to go to www.floridahospital.com except if the user goes to fh.floridahospital.com/heartland. The sites are hosted on two different machines.
<VirtualHost fh.floridahospital.com floridahospital.com>
RewriteEngine on
AllowOverride All
RewriteBase /
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!fh\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://fh.%2%3 [NC,R=301,L]
RewriteRule ^/heartland$ http://fh.floridahospital.com/heartland/home.aspx [NC,R=301,L]
RewriteRule ^/heartland/(.+)$ http://fh.floridahospital.com/heartland/$1 [NC,R=301,L]
#My entry
#Permanent redirect to update old links
RewriteRule (.+) http://www.floridahospital.com [R=301,L]
</VirtualHost>
Any help is greatly appreciated.
Thanks,
Edward
I have a website fh.floridahospital.com that I want users to go to www.floridahospital.com except if the user goes to fh.floridahospital.com/heartland. The sites are hosted on two different machines.
<VirtualHost fh.floridahospital.com floridahospital.com>
RewriteEngine on
AllowOverride All
RewriteBase /
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!fh\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://fh.%2%3 [NC,R=301,L]
RewriteRule ^/heartland$ http://fh.floridahospital.com/heartland/home.aspx [NC,R=301,L]
RewriteRule ^/heartland/(.+)$ http://fh.floridahospital.com/heartland/$1 [NC,R=301,L]
#My entry
#Permanent redirect to update old links
RewriteRule (.+) http://www.floridahospital.com [R=301,L]
</VirtualHost>
Any help is greatly appreciated.
Thanks,
Edward
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Help w/rewrite from old web to new with exception
Hello, try to replace existing with the following rule:
and
Regards
Andrew
- Code: Select all
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^fh\.(.+)$ [NC]
RewriteCond %{REQUEST_URI} !^/heartland.* [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://fh.%2%3 [NC,R=301,L]
and
- Code: Select all
RewriteRule ^heartland$ http://fh.floridahospital.com/heartland/home.aspx [NC,R=301,L]
RewriteRule ^heartland/(.+)$ http://fh.floridahospital.com/heartland/$1 [NC,R=301,L]
Regards
Andrew
- edcartagena
-
- Posts: 3
- Joined: 25 Apr 2013, 15:46
Re: Help w/rewrite from old web to new with exception
Andrew,
Thank you for your reply. When I added your entry I got the following in the address bar:
http://fh.floridahospital.com/,http://fh.floridahospital.com/Default.aspx?TabId=6686&language=en-US
http://fh.floridahospital.com/heartland/,http://fh.floridahospital.com/Default.aspx?TabId=2171&language=en-US
Which displays the following error in the browser:
A potentially dangerous Request.Path value was detected from the client (:).
Here's what I have:
<VirtualHost fh.floridahospital.com floridahospital.com>
RewriteEngine on
AllowOverride All
RewriteBase /
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^fh\.(.+)$ [NC]
RewriteCond %{REQUEST_URI} !^/heartland.* [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://fh.%2%3 [NC,R=301,L]
RewriteRule ^heartland$ http://fh.floridahospital.com/heartland/home.aspx [NC,R=301,L]
RewriteRule ^heartland/(.+)$ http://fh.floridahospital.com/heartland/$1 [NC,R=301,L]
</VirtualHost>
Thank you for your reply. When I added your entry I got the following in the address bar:
http://fh.floridahospital.com/,http://fh.floridahospital.com/Default.aspx?TabId=6686&language=en-US
http://fh.floridahospital.com/heartland/,http://fh.floridahospital.com/Default.aspx?TabId=2171&language=en-US
Which displays the following error in the browser:
A potentially dangerous Request.Path value was detected from the client (:).
Here's what I have:
<VirtualHost fh.floridahospital.com floridahospital.com>
RewriteEngine on
AllowOverride All
RewriteBase /
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^fh\.(.+)$ [NC]
RewriteCond %{REQUEST_URI} !^/heartland.* [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://fh.%2%3 [NC,R=301,L]
RewriteRule ^heartland$ http://fh.floridahospital.com/heartland/home.aspx [NC,R=301,L]
RewriteRule ^heartland/(.+)$ http://fh.floridahospital.com/heartland/$1 [NC,R=301,L]
</VirtualHost>
- edcartagena
-
- Posts: 3
- Joined: 25 Apr 2013, 15:46
Re: Help w/rewrite from old web to new with exception
Forgot to add this to my previous post:
#My entry
#Permanent redirect to update old links
RewriteRule (.+) http://www.floridahospital.com [R=301,L]
#My entry
#Permanent redirect to update old links
RewriteRule (.+) http://www.floridahospital.com [R=301,L]
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Help w/rewrite from old web to new with exception
There're 2 options:
- Double-registration. Check here how to fix it http://www.helicontech.com/articles/isapi_rewrite-double-registration/
- The Location header on your side is setup twice, but it has nothing to do with ISAPI_Rewrite
Regards
Andrew
- Double-registration. Check here how to fix it http://www.helicontech.com/articles/isapi_rewrite-double-registration/
- The Location header on your side is setup twice, but it has nothing to do with ISAPI_Rewrite
Regards
Andrew
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 17 guests