I've been using the suggestion sent to me via richardk on this board for rewriting some dynamic query string URLS to more SEO friendly ones and it's working great. My current .htaccess file has:
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.+)$ /index.php?$1 [QSA,L]
This correctly changes URLs like http://example.com/index.php?anypage to http://example.com/anypage.
I've found some stale links in some of the search engines, so now I need to add about 10 Redirect 301 rules. Problem is, they're getting caught in the rewrite ruleset. Example:
http://example.com/contactus.html no longer exists. I would like that URL to be directed to http://example.com/contactus (really index.php?contactus) but no matter where I put the redirect 301 rule, I wind up with /contactus?contactus.html
Any pointers (including to relevant reading so I can figure this out) would be greatly appreciated.
Many thanks,
-Ray