Simple Find Replac

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 29
Joined: 17 Apr 2013, 18:55

Simple Find Replac

18 Apr 2013, 14:14

Okay....I wish I did this RegEx stuff more often. Anton....you are truly a magician.

I know this is a simple one....but I was not able to find a quick solution. I have some strange function.session-starts appearing in the Google Index. I need them to resolve back to their normal self.

Here are the samples:

http://www.avst.com/blog/1002/function.session-start
http://www.avst.com/blog/1020/function.session-start
http://www.avst.com/blog/1039/function.session-start


So I would like:
http://www.avst.com/blog/1002/function.session-start -> http://www.avst.com/blog/1002/
http://www.avst.com/blog/1020/function.session-start -> http://www.avst.com/blog/1020/
http://www.avst.com/blog/1039/function.session-start -> http://www.avst.com/blog/1039/


In other words...anytime I match "function.session-start" with /blog, I would like it to be removed to the trailing slash.

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

Re: Simple Find Replac

19 Apr 2013, 05:08

Hello,

Please try the following rule:

RewriteBase /
RewriteRule ^(blog/\d+/)function\.session-start$ /$1 [NC,R=301,L]

User avatar
Posts: 29
Joined: 17 Apr 2013, 18:55

Re: Simple Find Replac

19 Apr 2013, 16:16

Thanks Anton....as always.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 18 guests