Question

I am currently using the following to redirect just the homepage of my site

RedirectMatch 301 ^/$ http://www.example.com/it/

However, it is also redirecting urls which have the following format

so the following url http://www.example.com/?act=25

becomes http://www.example.com/it/?act=25

Is there a way i can tell the htaccess rule not to redirect urls with that format i.e. starting with a query string?

Was it helpful?

Solution

used Mod-rewrite

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{QUERY_STRING} !^act=(.*)$ [NC]
RewriteRule ^$ http://www.example.com/it/
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top