PhP and SSL certificate issue.

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Sun Nov 04, 2012 6:02 am

PhP and SSL certificate issue.

Postby dolke » Sun Nov 04, 2012 6:21 am


Im not PHP developer but I consider myself advanced user. I have one issue where I think some knowledge of PHP might help me to solve it and who knows, maybe I will learn it eventually :) .

okay, here is the deal. I have website which is custom written and uses PHP/MySQL.
I recently bought SSL certificate for it and my hosting provider got it installed for me.

I tried to use rewrite in the htaccess file but there has been issues. Code is:

Code: Select all

#RewriteCond %{HTTPS} off
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
#Options +FollowSymLinks

It seems that content like images and links are not displayed well. I'm getting website without formatting and when I click on the certificate there is notification that encryption is not good for most of the content. Please see the attached screenshots. You can also see the difference of displaying the website in Chrome and FireFox browsers.

I was chating with the support technician and he told me that I need to change URLs for all my content in each files from HTTP to HTTPS but I dont know how to do that as Im not familiar with the PHP.

Is there some script or code that can I include on the pages in order to rewrite all the paths, image paths included, in order for the SSL certificate to work ok and to get HTTPS written in green instead read and crossed like now?


Thank you all in advance.

php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Re: PhP and SSL certificate issue.

Postby seandisanti » Wed Nov 07, 2012 3:09 pm

I'd make sure that your absolute paths that you're using in your code are specifying https also.
for example:

Code: Select all

<link rel="stylesheet" type="text/css" href="[u][b]https[/b][/u]://" />

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 5 guests