How do I enable https in laragon?


  • | 174 points

    How do I enable https in laragon, so instead of it always going to http how would I make it go to https always?


  • | 4363 points

    @Some-T For that, you'll need to add some rules to Apache's .htaccess (In project).

    Something like this (most simple way to do this):

    <IfModule mod_rewrite.c>
        RewriteEngine on
        
        RewriteCond %{HTTPS} off
        RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
    </IfModule>
    

    Depending what you'll need/want, you might need to tweak this a bit. You could add these to .conf file created by Laragon, but it would get overwritten in case you choose to regenerate those confs.

    If you're using Nginx, you'll need something like this: https://bjornjohansen.no/redirect-to-https-with-nginx (I don't use Nginx currently, so I can't give specific instructions).

    And of course, you'll need to enable SSL and auto-generate options in Laragon.


  • | 174 points

    Many thanks!


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.