In htaccess, how do you 301 redirect dynamic pages?
For example, what if I wanted a rule that made /get.php?i=1234
to redirect to /i/1234
, etcetera?
You can use mod_rewrite like redirection as in this code:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^(i)=([^&]+)(&|$) [NC]
RewriteRule ^get\.php$ %1/%2? [L,R=301,NC]