php - .htaccess https rewrite error redirection loop -
my .htaccess
code giving me error this webpage has redirect loop
in chrome browser.
can correct .htaccess
code?
rewriteengine on rewritecond %{http_host} ^purchase\.com\.au$ [or] rewritecond %{http_host} ^www\.purchase\.com\.au$ rewriterule ^(.*)$ "https\:\/\/purchase\.com\.au\/$1" [r=301,l] rewritecond %{script_filename} !-d rewriterule ^([^\.]+)$ $1.php [nc,l] directoryindex index.html index.php
if website address purchase.com.au , need redirect https://purchase.com.au
try this:
rewritecond %{https} off rewriterule ^(.*)$ https://%{http_host}%{request_uri} [l,r=301]
basically checkes if https off (request made via http - no https) , redirect every request https variant (same url goes https instead of http)
Comments
Post a Comment