dot htaccess 301 redirect not working

keith smith klsmith2020 at yahoo.com
Fri Apr 6 20:43:30 MST 2012


Hi,

I'm trying to configure some 301 redirects.

The old URL looks like this : www.mydomain.tld/article.php?id=1

I need it to redirect to a new URL like this  www.mydomain.TLD/category-name/article-name

This Works : note I removed the ?id=1 from RewriteRule ^article\.php$ 

RewriteCond %{HTTP_HOST} ^mydomain\.tld$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mydomain\.tld$
RewriteRule ^article\.php$ "http\:\/\/www\.mydomain\.tld\/category-name\/article-name"  [R=301,L]

This does not work - Note : RewriteRule ^article\.php?id=1$

RewriteCond %{HTTP_HOST} ^mydomain\.tld$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mydomain\.tld$
RewriteRule ^article\.php?id=1$ "http\:\/\/www\mydomain\.tld\category-name\/article-name"  [R=301,L]

Thank you for any guidance.



------------------------

Keith Smith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20120406/5a5d6bc6/attachment.html>


More information about the PLUG-discuss mailing list