example.com is my site’s url.
It has a redirect loop on the line where it redirects to https.
Any fix?
Also how would I hide the PHP extension?
I have nginx 1.9.3 on ubuntu.
server {
listen 80 default_server;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php;
server_name example.com;
return 301 https://example.com$request_uri; # Where it loops
error_page 500 /500.html;
error_page 404 /404.php;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
#htacess stuff
}
}
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!
Change
return 301 https://example.com$request_uri;
toreturn 301 https://$server_name$request_uri;
And where is your 443 listen? You can’t point to https if you didn’t set it up :)