Re: rewriting URLs, part II -- 301 redirect from old dynamic URLs

"web_design" <web_design@xxxxxxxxxxxxxxxxx> wrote in message
>> -----------------------------------------------------------------------
>> # This part works:
>> RewriteEngine On
>> RewriteRule ^(.+)(\.htm)$ /index.php?p=$1 [L]
>> # This is the part that doesn't work:
>> RedirectMatch 301 /index.php?p=(.*)$$1.htm
> -------------------------------------------------------------------------------------
> I'm wondering:
> Is the [L] a problem?
> Should the ? in the RedirectMatch be escaped by a backslash?
> Do I need an [R] somewhere?
> Do I need to escape all my periods with backslashes?
> I'm experimenting with these but haven't had any luck yet. I also added a
> forward slash, which was recommended to me, so it looks like this now:
> RedirectMatch 301 /index.php?p=(.*)$$1.htm

Through a lot of experimentation I've narrowed the problem down to this one

I know this because I've tried regular redirects without success, for
RedirectMatch 301 /index.php?p=(.*)$
Redirect 301 /index.php?p=page1

and it doesn't work. But this works:
Redirect 301 /


Relevant Pages