.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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -