Redirect HTTP to HTTPS .htaccess

70 Views Asked by At

I am new to using the .htaccess file to redirect HTTP to HTTPS. I am using PHP codeigniter. I currently have this code in the file but when I load my website it gives a 503 error. I have been looking at so many resources online and trying different ways to accomplish this but none of them work for me.

RewriteEngine on

RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
RewriteRule ^([a-zA-Z0-9/]+)$ index.php?vista=$1

Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type,http_authorization"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"


can someone render me some assistance? This is getting really frustrating :/

0

There are 0 best solutions below