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

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -