regex - rewrite url to non www multiple sites -
regex - rewrite url to non www multiple sites -
i have sites running same files different templates, goal forcefulness utilize www or non www domains.
this code:
rewritecond %{https} (on)? rewritecond %{http:host} ^(?!www\.)(.+)$ [nc] rewritecond %{request_uri} (.+) rewritecond %{http:host} ^[^.]+\.[a-z]{2,5}$ [nc] rewriterule .? http(?%1s)://www.%2%3 [r=301,l]
get other question on stackoverflow :)
but if utilize www domain ok, if not redirect
http://domain.de/www/htdocs/user/_production/http%28?s%29://www.
why not simplify rules this:
options +followsymlinks -multiviews rewriteengine on rewritecond %{https} !=on rewritecond %{http_host} !^www\. [nc] rewriterule ^ http://www.%{http_host}%{request_uri} [r=301,l] rewritecond %{https} =on rewritecond %{http_host} !^www\. [nc] rewriterule ^ https://www.%{http_host}%{request_uri} [r=301,l]
regex .htaccess mod-rewrite
Comments
Post a Comment