ReWriteRule Issue

ISAPI_Rewrite is a powerful URL manipulation engine based on regular expressions
User avatar
Posts: 8
Joined: 08 Aug 2012, 07:01

ReWriteRule Issue

08 Aug 2012, 07:10

Please help! I’m new to ISAPI_ReWrite and completely confussed!

I have redesigned my website and changed the location of files to a new directory. Therefore need to redirect any page request to the new location.

After looking through the ISAPI_Rewrite documentation the following script was created, but unfortunately I cannot get the redirect to work.


[ISAPI_Rewrite]

RewriteCond Host: www\.damp-meter-direct\.co\.uk

RewriteEngine on
RewriteRule /Articles/How_to_measure_moisture_in_floors\.pdf$ http\:www\.damp-meter-direct\.co\.uk/PDF/Articles/How_to_measure_moisture_in_floors\.pdf$1 [L,RP]


Thanks

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

Re: ReWriteRule Issue

08 Aug 2012, 07:43

Hello,

Please try to fix your config like this:

[ISAPI_Rewrite]
RewriteCond Host: www\.damp-meter-direct\.co\.uk
RewriteRule /Articles/How_to_measure_moisture_in_floors\.pdf$ http\://www.damp-meter-direct.co.uk/PDF/Articles/How_to_measure_moisture_in_floors\.pdf [I,RP]

User avatar
Posts: 8
Joined: 08 Aug 2012, 07:01

Re: ReWriteRule Issue

08 Aug 2012, 12:46

Thank you. I have posted this back into the site.

But nothing has happened.

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

Re: ReWriteRule Issue

09 Aug 2012, 05:05

Hello, Ian

Please confirm you are using ISAPI_Rewrite 2 not 3.

Then please have another small fix to the config:

[ISAPI_Rewrite]
RewriteCond Host: www\.damp-meter-direct\.co\.uk
RewriteRule /Articles/How_to_measure_moisture_in_floors\.pdf http\://www.damp-meter-direct.co.uk/PDF/Articles/How_to_measure_moisture_in_floors.pdf [I,RP]

And provide the test request you make and how you want the resulting URL to look like.

User avatar
Posts: 8
Joined: 08 Aug 2012, 07:01

Re: ReWriteRule Issue

10 Aug 2012, 06:06

Thank you

After the hosting provider confirming that it was v2, they have now told me its v3! Not happy :-{

Thank you for your help. Now lets try the script again!!!

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

Re: ReWriteRule Issue

10 Aug 2012, 07:55

Ok, that makes sense. Please try the following config then:

RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.damp-meter-direct\.co\.uk$ [NC]
RewriteRule ^Articles/How_to_measure_moisture_in_floors\.pdf$ /PDF/Articles/How_to_measure_moisture_in_floors.pdf [NC,R=301,L]

User avatar
Posts: 8
Joined: 08 Aug 2012, 07:01

Re: ReWriteRule Issue

15 Aug 2012, 06:28

Yep everything works fine now!!!

Thank you

Return to ISAPI_Rewrite 2.x

Who is online

Users browsing this forum: No registered users and 3 guests