How yo force https all Filament routes

Hello, how I can force al Filament routes yo use Https?
10 Replies
Hotcat
Hotcat15mo ago
Probably you need to config laravel not filament. https://stackoverflow.com/a/44442699
Stack Overflow
Laravel HTTPS routes
today I decided to move my website to HTTPS. Early my website work on HTTP. My problem is in misunderstood how Laravel pass HTTP and https in helpers function route('name') I change my website UR...
Hotcat
Hotcat15mo ago
Or to configure your server Apache/Nginx
awcodes
awcodes15mo ago
If you just set your APP_URL in your .env to https. Laravel will pick that up and serve all routes with it.
H.Bilbao
H.BilbaoOP14mo ago
As you say I have it configured, but if a user enters with http it does not redirect to https. I don't know if you can see that it is on a subdomain.
krekas
krekas14mo ago
It's not a filament problem. Your server configuration
H.Bilbao
H.BilbaoOP14mo ago
I've tried this in .htaccess file but it doesn't work as I would like:
# Redirect HTTP to HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Redirect HTTP to HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
For example, if I put http://demo.domain.com/admin in the URL it redirects to https://demo.domain.com and I would like it to redirect to https://demo.domain.com/admin
cheesegrits
cheesegrits14mo ago
Do you also want https://demo.domain.com to redirect to https://demo.domain.com/admin ? As krekas said, nothing to do with Filament, it's just basic server config, I'm just interested.
awcodes
awcodes14mo ago
Is your server using nginx as a proxy for Apache? I’m not an expert on this stuff but something to consider.
krekas
krekas14mo ago
Really doubt it needs to be done in .htaccess
cheesegrits
cheesegrits14mo ago
Normalizing the schema yes, best done in htaccess. Redirecting from / to /admin could be done in a Laravel route. Still no Filament.
Want results from more Discord servers?
Add your server