.htaccess - <http:// to http://www.> and <https:// to https://www.> -


there not say, because wanna try explain easy.

is there way create .htaccess these things:

example.com > http://www. example.com

http:// example.com > http:// www. example.com

https:// example.com > https:// www. example.com

what mean like:

  1. if http, goes http + www
  2. if https goes https + www
  3. if nothing in front of domain, goes http + www

i've tried make work code:

rewritecond %{http_host} ^[^.]+\.[^.]+$ rewriterule ^(.*) http://www.%{http_host}/$1 [r=301] 

that code works, thing wrong it, when https:// example.com redirects http:// www. example.com

if doesn't work, can write separate rule https , http:

rewritecond %{https} !on rewritecond %{http_host} !^www\. [nc] rewriterule ^(.*)$ http://www.xplayrs.com/$1  [l]  rewritecond %{https} on rewritecond %{http_host} !^www\. [nc] rewriterule ^(.*)$ https://www.xplayrs.com/$1  [l] 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -