문제

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?

도움이 되었습니까?

해결책

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/
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top