apache - mod_rewrite based on current HTTP_HOST and HTTP_REFERER -


is possible make such check htaccess mod_rewrite - if referer domain example.com , current host www.example.com redirect user example.com domain. meaning keep user @ first visiting domain (www or non-www). thanks!

see, if works you.

rewriteengine on rewritebase /  rewritecond ${http_host} ^domain\.com [nc] rewritecond ${http_referer} ^http://www\.domain\.com rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,l]  rewritecond ${http_host} ^www\.domain\.com [nc] rewritecond ${http_referer} ^http://domain\.com rewriterule ^(.*)$ http://domain.com/$1 [r=301,l] 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -