apache - add www on http and remove www on https -


i trying following:

add www non secure http://domain[.]com http://www.domain[.]com

&

remomve www on secure https://www[.]domain.com https://domain[.]com

i trying doesn't seem work

rewritecond %{https} off rewritecond %{http_host} ^example.org$ rewriterule ^(.*)$ http://www.example.org/$1 [r=301,l]  rewritecond %{https} on rewritecond %{http_host} ^example.org$ rewriterule ^(.*)$ https://example.org/$1 [r=301,l] 

try this:

rewritecond %{https} off rewritecond %{http_host} ^example\.org$ [nc] rewriterule ^(.*)$ http://www.example.org/$1 [r=301,l]  rewritecond %{https} on rewritecond %{http_host} ^www\.example\.org$ [nc] rewriterule ^(.*)$ https://example.org/$1 [r=301,l] 

your second http_host condition still checks www. missing, should other way around.


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -