Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0 support forum
 Helicon Tech : ISAPI_Rewrite 3.0 support forum
Subject Topic: RewriteCond full request URL Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
ChrisQuinn
Newbie
Newbie


Joined: 23 July 2008
Location: United States
Online Status: Offline
Posts: 6
Posted: 10 August 2008 at 8:41pm | IP Logged Quote ChrisQuinn

I am trying to write a rule that will redirect from http://sps.ind.roche.com/sites/454-IT-Department/default.aspx to http://na-ts01.dia.roche.com/sites/454 IT Department/default.aspx

I need to send several variants to this site.

Here are the rules I am trying to use and I think that I am just not referencing the correct conditional variable.

RewriteEngine on

RewriteLogLevel 9

LogLevel debug

RewriteLog "C:\Program Files\Helicon\ISAPI_Rewrite3\rewrite.log"

ErrorLog "C:\Program Files\Helicon\ISAPI_Rewrite3\error.log"

RewriteBase /

RewriteCond %{HTTP_HOST} ^(?:www\.)?sps\.ind\.roche\.com/sites/454-IT-Department(.*) [NC]

RewriteRule (.*) http://na-ts01.dia.roche.com/sites/454\%20IT\%20Department$1 [NC,R]

RewriteCond %{HTTP_HOST} ^(?:www\.)?sps\.ind\.roche\.com/sites/454_IT_Department(.*) [NC]

RewriteRule (.*) http://na-ts01.dia.roche.com/sites/454\%20IT\%20Department$1 [NC,R]

RewriteCond %{HTTP_HOST} ^(?:www\.)?na-ts01\.dia\.roche\.com/sites/454-IT-Department(.*) [NC]

RewriteRule (.*) http://na-ts01.dia.roche.com/sites/454\%20IT\%20Department$1 [NC,R]

RewriteCond %{HTTP_HOST} ^(?:www\.)?na-ts01\.dia\.roche\.com/sites/454_IT_Department(.*) [NC]

RewriteRule (.*) http://na-ts01.dia.roche.com/sites/454\%20IT\%20Department$1 [NC,R]

 

This is of course a IIS based site.

Back to Top View ChrisQuinn's Profile Search for other posts by ChrisQuinn Visit ChrisQuinn's Homepage
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4837
Posted: 11 August 2008 at 4:58am | IP Logged Quote Anton

Please try to use the following rules:

RewriteCond %{HTTP_HOST} ^(?:www\.)?sps\.ind\.roche\.com$

RewriteRule ^sites/(\d+)-IT-Department/default\.aspx$ sites/$1\%20IT\%20Department/default.aspx [NC,R,L]

RewriteCond %{HTTP_HOST} ^(?:www\.)?sps\.ind\.roche\.com$

RewriteRule ^sites/(\d+)_IT_Department/default\.aspx$ sites/(\d+)\%20IT\%20Department/default.aspx [NC,R,L]

RewriteCond %{HTTP_HOST} ^(?:www\.)?na-ts01\.dia\.roche\.com

RewriteRule ^sites/(\d+)-IT-Department/default\.aspx$ sites/$1\%20IT\%20Department/default.aspx [NC,R,L]

RewriteCond %{HTTP_HOST} ^(?:www\.)?na-ts01\.dia\.roche\.com$

RewriteRule ^sites/(\d+)_IT_Department/default\.aspx sites/$1\%20IT\%20Department/default.aspx [NC,R,L]



__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
ChrisQuinn
Newbie
Newbie


Joined: 23 July 2008
Location: United States
Online Status: Offline
Posts: 6
Posted: 11 August 2008 at 8:40am | IP Logged Quote ChrisQuinn

Thank you for the assistance but I did not make my intent clear. I am trying to redirect four possible permutations of the same root URL but different sub sites to the same sub site. In other words the four paths listed below should all lead to the same site (http://na-ts01.dia.roche.com/sites/454 IT Department).

 

http://sps.ind.roche.com/sites/454-IT-Department

http://sps.ind.roche.com/sites/454_IT_Department (this has an underscore instead of spaces)

http://na-ts01.dia.roche.com/sites/454-IT-Department

http://na-ts01.dia.roche.com/sites/454_IT_Department (this has an underscore instead of spaces)

 

Thank you for you fast response.

Back to Top View ChrisQuinn's Profile Search for other posts by ChrisQuinn Visit ChrisQuinn's Homepage
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4837
Posted: 11 August 2008 at 9:40am | IP Logged Quote Anton

Please try to fix the rules like this:

RewriteCond %{HTTP_HOST} ^(?:www\.)?sps\.ind\.roche\.com$

RewriteRule ^sites/(\d+)-IT-Department/default\.aspx$ http://na-ts01.dia.roche.com/sites/$1\%20IT\%20Department/default.aspx [NC,R,L]

RewriteCond %{HTTP_HOST} ^(?:www\.)?sps\.ind\.roche\.com$

RewriteRule ^sites/(\d+)_IT_Department/default\.aspx$ http://na-ts01.dia.roche.com/sites/(\d+)\%20IT\%20Department/default.aspx [NC,R,L]

RewriteCond %{HTTP_HOST} ^(?:www\.)?na-ts01\.dia\.roche\.com

RewriteRule ^sites/(\d+)-IT-Department/default\.aspx$ http://na-ts01.dia.roche.com/sites/$1\%20IT\%20Department/default.aspx [NC,R,L]

RewriteCond %{HTTP_HOST} ^(?:www\.)?na-ts01\.dia\.roche\.com$

RewriteRule ^sites/(\d+)_IT_Department/default\.aspx http://na-ts01.dia.roche.com/sites/$1\%20IT\%20Department/default.aspx [NC,R,L]



__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
ChrisQuinn
Newbie
Newbie


Joined: 23 July 2008
Location: United States
Online Status: Offline
Posts: 6
Posted: 11 August 2008 at 10:47am | IP Logged Quote ChrisQuinn

That worked perfectly. I am so glad my company purchased this product and hope we make it our global standard.
Back to Top View ChrisQuinn's Profile Search for other posts by ChrisQuinn Visit ChrisQuinn's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You can vote in polls in this forum