Forum Moderators: phranque

Message Too Old, No Replies

301 redirects for multi-variable ASP URLs

         

lightgirl

12:09 pm on Jun 9, 2016 (gmt 0)

5+ Year Member



I have tried repeatedly to set 301 redirects for this particular old URL and I just can't get anything to work. If anyone enjoys solving these rewrite puzzles, I would be grateful for any help.

http://www.example.com/subdir/anmviewer.asp?a=7&z=2 which should redirect to: http://www.example.com/april-20-2004

I have tried:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^a=78&z=2$ [NC]
RewriteRule subdir/anmviewer.asp http://www.example.com/april-20-2004/? [R=301,L]

But it fails. Can anyone detect what I'm doing wrong?

Thanks in advance for any help.

lucy24

6:06 pm on Jun 9, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



http://www.example.com/subdir/anmviewer.asp?a=7&z=2 which should redirect to: http://www.example.com/april-20-2004
<snip>
RewriteCond %{QUERY_STRING} ^a=78&z=2$ [NC]

Typo when posting, or actual typo in code?

lightgirl

1:15 am on Jun 10, 2016 (gmt 0)

5+ Year Member



Oh mercy, it was a dumb typo in the code. I corrected htaccess entry and now it works fine. Thanks very much for catching my error, and sorry for the bother.