Forum Moderators: phranque
original url = mysite.com/index.aspx?id=28
new url = mysite.com/privacy-statement/
.htaccess file
---------------
RewriteCond %{QUERY_STRING} ^id=28$
RewriteRule ^index\.aspx$ http://www.mysite.com/privacy-statement/? [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
RewriteCond %{THE_REQUEST} [A-Z]{3,9}\ /(index\.aspx)?\?id=28\ HTTP/
RewriteRule ^(index\.aspx)?$ http://www.example.com/privacy-statement/? [R=301,L] RewriteCond %{THE_REQUEST} [A-Z]{3,9}\ /(index\.php)?\?
RewriteCond %{QUERY_STRING} (^|&)id=28(&|$)
RewriteRule ^(index\.aspx)?$ http://www.example.com/privacy-statement/? [R=301,L] IfModule containers. RewriteEngine On should appear ONCE, at the beginning of the code.