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

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -