redirect to new picture (newbie)

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 3
Joined: 04 Apr 2013, 06:04

redirect to new picture (newbie)

04 Apr 2013, 06:22

Hi there
I am a newbie on Url rewriting with very little chance to write new rules.
I am running IIS 6 and I see Helicon ISAPI_Rewrite 3.1.0.78
Here is my requirement: change the logo image to a new one.
<whatever protocol><whatever method><whatever site>, every time there is "logo.gif" , then redirect to newpath/newlogo.gif

I would much appreciate if someone could tell me how to achieve that.
Thanks

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: redirect to new picture (newbie)

04 Apr 2013, 10:15

Hello,

Lets try using:

Code: Select all
RewriteEngine on
RewriteBase /

RewriteRule logo\.gif /newpath/newlogo.gif [NC,R=301,L]


Regards
Andrew

User avatar
Posts: 3
Joined: 04 Apr 2013, 06:04

Re: redirect to new picture (newbie)

04 Apr 2013, 10:56

Thanks for that quick answer, in the meantim, I've checked and confirm that the url rewriting module is up and running.
so I put what you mentioned into the .htaccess as shown below

Code: Select all
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.78

RewriteEngine on

RewriteBase /

RewriteRule /QueryCentre/Static/Images/wn_logo\.gif /QueryCentre/Static/Images/Logo_white.jpg [NC,R=301,L]


My IIS logs looks like
Code: Select all
W3SVC1  GET /QueryCentre/Static/Images/wn_logo.gif - 443 -


Still it does not redirect... (why there is a backslash before .gif?)

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: redirect to new picture (newbie)

04 Apr 2013, 15:38

Instead of

Code: Select all
RewriteRule /QueryCentre/Static/Images/wn_logo\.gif /QueryCentre/Static/Images/Logo_white.jpg [NC,R=301,L]

Try using
Code: Select all
RewriteRule ^QueryCentre/Static/Images/wn_logo\.gif /QueryCentre/Static/Images/Logo_white.jpg [NC,R=301,L]


Also, IIS log won't show you anything. YOu need to use rewrite.log to see how request is processed. Logging issues are described in FAQ - http://www.helicontech.com/forum/10648-FAQ.html

We use '\' to escape '.', since in the left part of the rule we use regular expressions.

Regards
Andrew

User avatar
Posts: 3
Joined: 04 Apr 2013, 06:04

Re: redirect to new picture (newbie)

05 Apr 2013, 03:30

That's working fine now.
I am using IIS logs just to see "hits details" not for the Url rewriting stuff.
Thanks a lot!

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: Majestic-12 [Bot] and 10 guests