Last active
February 24, 2020 08:21
-
-
Save ansargondal/34a577242a771d8098e6b23e11883960 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APPLICATION LEVEL CONFIGS: | |
- Edit app/Providers/AppServiceProvider.php | |
- Add the following code in the boot method | |
- URL::forceScheme('https'); | |
- It will make sure to server all the content, links, form actions over https instead of http. | |
SERVER LEVEL CONFIGS: | |
- Edit vi /etc/apache2/sites-available/000-default.conf file | |
- add the following code in <VirtualHost *:80> tag | |
RewriteEngine On | |
RewriteCond %{HTTP:X-Forwarded-Proto} =http | |
RewriteRule .* https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent] | |
- add the following code in the <Directory /var/www/html/cdis/public> tag which will be inside <VirtualHost *:80> tag | |
RewriteEngine On | |
RewriteCond %{HTTP:X-Forwarded-Proto} =http | |
RewriteRule .* https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent] | |
- restart the server and we are good to go! | |
- sudo service apache2 restart | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment