migrate php site from http to https

i read the other threads about this topic but i couldn't find anything that i felt could apply in my case. It seams pretty basic though. I have a website built in php with apache server. In this moment all the traffic is done via http. The people who paid for the site, now want to move it to https. They bought a certificate and the web server hosts will install it. What changes do i need to make to make it work via https, besides changing the redirects within the code? I also found this link which seems pretty helpful, but i think maybe it's too complex?

Thank you, Alex

Answers


You should change your resource links (like external JavaScript references such as jQuery) in the site where there are hard-coded paths in http://domain.name/some-link-here to just //domain.name/some-link-here. This will prevent the browser from complaining about mixed-mode content.

For links that are on the same domain, you could use absolute/relative URLs.

After that you can place and .htaccess such that any URLs accessed on the domain would automatically redirect to the HTTPS version. Place the following lines as the first rule in the file

.htaccess code:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

The .htaccess will also take care of any hard-coded links (towards the same domain/site) that you might have in your site and that you have missed.


Need Your Help

Retrieve attributes from the tag that imported the script

javascript attributes custom-data-attribute

<script data-src="scripts/" src="scripts/myscript.js"></script>

All devices targets on xcode become “unavailble”

iphone xcode

I have tried to install xcode 4.6 together with my existing xcode 6.3.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.