bramus/router

HTTPS auto redirect with .htaccess

pTinosq opened this issue · 1 comments

Hello everyone,

I'm still getting used to how the router works at the moment and I've been trying to get https redirecting working with no luck.
I would really appreciate it if someone could explain what I would need to change in order to get this feature working.

Here is my .htaccess file:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /

# Router
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [NC,L]

ErrorDocument 404 /404.html

# Prevent viewing of .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>

#Prevent directory listings
Options All -Indexes

I assume the line RewriteRule ^ index.php [NC,L] will need to be updated, I just have no idea where to start.

This is an Apache configuration problem, not a bramus/router issue. Please refer to https://www.bram.us/2021/02/15/apache-htaccess-enforce-https/ for a solution.