Rewrite help

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 11
Joined: 13 Aug 2012, 18:17

Rewrite help

20 Aug 2012, 12:42

I am trying to redirect some old urls but the normal expression I am using will not work

Here are some of the urls I am trying to redirect:
http://www.mysite.biz/sitemaps/sitemap99-27.htm
https://www.mysite.biz/sitemaps/sitemap97-52.htm
https://www.mysite.biz/sitemaps/sitemap99-77.htm
https://www.mysite.biz/sitemaps/sitemap97-10.htm
https://www.mysite.biz/sitemaps/sitemap97-100.htm
https://www.mysite.biz/sitemaps/sitemap97-84.htm
https://www.mysite.biz/sitemaps/sitemap97-71.htm
https://www.mysite.biz/sitemaps/sitemap97-70.htm
https://www.mysite.biz/sitemaps/sitemap97-20.htm
https://www.mysite.biz/sitemaps/sitemap97-19.htm

I would like to redirect to this url:
https://www.mysite.biz/sitemap.asp

I am using this rewrite, but receive a 404:
RewriteEngine on
RewriteBase /
Rewriterule ^sitemaps\sitemap*.htm$ /sitemap.asp [NC,R=301,L]

Should I be using a different expression to rewrite? I used the * as a wild card since the subfolder names change...

TIA

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

Re: Rewrite help

21 Aug 2012, 03:23

Hello,

You've missed the '.' in your rule before the '*':

RewriteEngine on
RewriteBase /
Rewriterule ^sitemaps\sitemap.*\.htm$ /sitemap.asp [NC,R=301,L]

User avatar
Posts: 16
Joined: 19 Nov 2012, 22:21

Re: Rewrite help

21 Nov 2012, 23:37

I usually miss those characters. This is a great recap regarding scripts.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 9 guests