.htaccess - match and exclude links from rewrite rule -
i know how exclude folders, file types don't know how exclude link contain specific word. have rule:
rewritecond %{http_host} ^www\.domain\.com rewriterule (.*) http://en.domain.com/$1 [qsa,l]
how exclude rule links have @ beginning: index.php?a=admin
this should trick:
rewritecond %{http_host} ^www\.domain\.com rewritecond %{request_filename} index\.php rewritecond %{query_string} !^a=admin rewriterule (.*) http://en.domain.com/$1 [qsa,l]
here, we're adding condition states rewrite may occur if host www.domain.com
, file being requested index.php
, , query string not being a=admin
.
so, www.domain.com/test
redirect en.domain.com/test
, www.domain.com/index.php?a=admin
not redirect @ all.
Comments
Post a Comment