Reputation: 305
Internal Server Error. .htaccess:
RewriteEngine on
RewriteCond %{QUERY_STRING} id=1
RewriteRule ^index\.php$ /path-to-new-location/? [L,R=301]
Redirect URLs with query parameters (files placed in subdirectory)
I tried redirect: http://www.example.com/index.php?id=1 to:
http://www.example.com/path-to-new-location/
Was found solution by myself:
RewriteEngine On
RewriteCond %{THE_REQUEST} ^(GET|POST)\ /index\.php\?g=(.*)\ HTTP
RewriteRule ^ /%2/%4\? [R,L]
Upvotes: 0
Views: 31
Reputation: 19935
It should be like this
RewriteEngine on
RewriteCond %{QUERY_STRING} id=1
RewriteRule ^index\.php$ /path-to-new-location/ [L,R=301]
# Redirect URLs with query parameters (files placed in subdirectory)
Upvotes: 1