Link to home
Start Free TrialLog in
Avatar of sharingsunshine
sharingsunshineFlag for United States of America

asked on

Rewrite Help Needed

I need to redirect a url

http://www.abc.com/12all/lt.phpc=1590&

to a discontinued page.  Here is what I have tried that isn't working.

RewriteCond %{REQUEST_URI} ^12all/lt\.phpc=([0-9]+)$ [NC]
RewriteCond %{QUERY_STRING} ^&amp$ [NC]
RewriteRule ^.+$ /discontinued.html? [NC,R=301,L]

I have other rewrites working but I can't seem to get this to pattern match so I need help.

Thanks,

Randal
ASKER CERTIFIED SOLUTION
Avatar of requeue
requeue

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of requeue
requeue

If my guess is correct htaccess is like this:

RewriteCond %{REQUEST_URI} ^/12all/lt\.php$ [NC]
RewriteCond %{QUERY_STRING} ^c=([0-9]+)&amp$ [NC]
RewriteRule ^(.+)$ /discontinued.html? [NC,R=301,L]

You need "/" before 12all.
Avatar of sharingsunshine

ASKER

You gave me the answer when you said it's not a query without a ?.  I removed the query string and it worked.

Thanks