Forum Moderators: phranque
Redirect /sales/index.php?id=myid http://www.mydomain.com/sales/sfurl.html
http://www.mydomain.com/sales/sfurl.html
# Externally redirect direct client requests for dynamic script filepath back to SE-friendly static URL
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /sales/index\.php\?id=myid\ HTTP/
RewriteRule ^sales/index\.php$ http://www.mydomain.com/sales/sfurl.html? [R=301,L]
# Externally redirect direct client requests for dynamic script filepaths back to SE-friendly static URLs
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /sales/index\.php\?id=([0-9]+)\ HTTP/
# requested id>new URL... id key>pattern to capture new URL
RewriteCond %1>/sfurlone.html ^1>(.+)$ [OR]
RewriteCond %1>/sfurltwo.html ^2>(.+)$ [OR]
# you can redirect to any filetype or URL-path
RewriteCond %1>/specials/sfurlthree.php ^3>(.+)$ [OR]
# redirect id=99 to /sfurlspl.html
RewriteCond %1>/sfurlspl.html ^99>(.+)$ [OR]
# redirect id=100 to home page "/"
RewriteCond %1>/ ^100>(.+) [OR]
# this last rewritecond must not have an [OR] on it!
RewriteCond %1>sfurllast.html ^101>(.+)$
RewriteRule ^sales/index\.php$ http://www.mydomain.com/sales%1? [R=301,L]