Fer1tx1
November 28, 2021, 5:57pm
#1
Hello there. I made the SSL settings in infinity free, but now I want it to redirect http directly to https from my .htaccess file. I tried a lot of code but after doing all of them I click somewhere and it gives 404 error please help me.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
this is the only working .htaccess code. Here it redirects to http. Even if I try all https or redirect codes, they all give 404 errors.
Use this code:
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https [OR]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Then clear your cache. If it is still not working, share your domain name and the entire contents of your .htaccess file.
1 Like
Fer1tx1
November 28, 2021, 6:06pm
#5
I’m sorry dude, but this doesn’t work, I tried many times and even deleted and reopened your file.
Then follow the rest of my post:
Fer1tx1
November 28, 2021, 6:24pm
#9
.htacces
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https [OR]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Its working, so you need to clear your cache or try a different browser. Your ISP may also be caching it, so try using a different device.
Fer1tx1
November 28, 2021, 6:27pm
#11
Dude, the homepage works, yes, but when I click on one of the categories, it gives a 404 error, I tried it from other devices and browsers.
Fer1tx1
November 28, 2021, 6:32pm
#12
I have no idea how to solve
Oh, I should have re-read the title, sorry.
Your .htaccess code is file, a 404 error means the page cannot be found. Remember that names must be excatly the same!
So. “hello.html” IS NOT THE SAME AS “Hello.html”
Fer1tx1
November 28, 2021, 6:40pm
#14
I’ve been looking, but I can’t find such a faulty file.
Its not one file, its all your files. Your links lead to filenames with no extensions that do not exist. Please screenshot the filemanager.
Admin
November 29, 2021, 3:08pm
#16
Which links return a 404 error? I checked https://flwus.com/ but there is only one landing page there as far as I can tell. I don’t see the categories you are referring to.
I think he means all the hyperlinks in the navbar
Admin
November 29, 2021, 3:30pm
#18
Which navbar? I only see a page saying “Coming Soon”, with no links or buttons on the page.
He changed it, it looked completely different before.
Fer1tx1
November 29, 2021, 5:10pm
#20
Oh I’m sorry. The site wasn’t like that yesterday, I changed it, now I’m going to do it again like yesterday.