what thing require to migrate from http to https

Published 1 week ago by bipin

hello, guys I m using laravel 5.4 version and recently I buy https and SSL certificate, now my problem is that what things are required to change in my project code or in xampp for eg currently my domain is like http://mydomain.com what file or code I had to change or rewrite after my URL or adding https ( https://mydomain.com) I m new to this thing

Best Answer (As Selected By bipin)
Cronix

You need to update the APP_URL in the .env file to your https version.

It's often helpful to add

\URL::forceScheme('https');

to the boot() method of the AppServiceProvider (in app/Providers)

One other thing you should do is at the server level. You should redirect http to https for apache/nginx. You shouldn't be able to access the site with http and https. One or the other, not both.

If you hardcoded any links with http, you should convert them all to https. If you used any of laravels helpers to generate urls, you should be fine.

If you are loading any 3rd party scripts, or anything else from an external host (maybe you're pulling in scripts from a cdn, or loading images from an external domain), those should all use the https version of the cdn.

After the above is done, start browsing your site and see if you get the green lock symbol on all pages. If you get any "mixed content" errors for a page, inspect it for any links/images/etc beginning with http and convert them.

shez1983

nothing else should be needed. laravel should already take care of making sure all links are now https.

Cronix
Cronix
1 week ago (573,640 XP)

You need to update the APP_URL in the .env file to your https version.

It's often helpful to add

\URL::forceScheme('https');

to the boot() method of the AppServiceProvider (in app/Providers)

One other thing you should do is at the server level. You should redirect http to https for apache/nginx. You shouldn't be able to access the site with http and https. One or the other, not both.

If you hardcoded any links with http, you should convert them all to https. If you used any of laravels helpers to generate urls, you should be fine.

If you are loading any 3rd party scripts, or anything else from an external host (maybe you're pulling in scripts from a cdn, or loading images from an external domain), those should all use the https version of the cdn.

After the above is done, start browsing your site and see if you get the green lock symbol on all pages. If you get any "mixed content" errors for a page, inspect it for any links/images/etc beginning with http and convert them.

Please sign in or create an account to participate in this conversation.