mod rewrite - RewriteCond and RewriteRule for .htaccess - always open as one unique URL -
what need is, whenever opens site, no matter how type url, url should opened same, i.e. no matter types:
example.com example.com/ www.example.com www.example.com/ http://example.com http://example.com/ http://www.example.com http://www.example.com/ https://example.com https://example.com/ https://www.example.com https://www.example.com/
the site should opened as:
https://www.example.com/
i've tried rewritecond , rewriterule in .htaccess, no success, site won't open, saying many redirects.
thanks in advance.
edit: here's content of .htaccess file:
options +followsymlinks options -indexes <filesmatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))"> order deny,allow deny </filesmatch> rewriteengine on rewritebase / rewriterule ^sitemap.xml$ index.php?route=feed/google_sitemap [l] rewriterule ^googlebase.xml$ index.php?route=feed/google_base [l] rewriterule ^system/download/(.*) index.php?route=error/not_found [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !.*\.(ico|gif|jpg|jpeg|png|js|css) rewriterule ^([^?]*) index.php?_route_=$1 [l,qsa]
i use :
rewritecond %{http_host} !^www\.example\.com [nc] rewriterule (.*) https://www.example.com/$1 [qsa,r=301,l]
Comments
Post a Comment