Jump to content

Problem with Logo and HTTPS


doubledee

Recommended Posts

(Trying to get my brain back into this old problem which I fixed but want to re-code a better way...)

 

So I was having problems with getting some browser error when people would go to checkout because the page logo was coming from an HTTP source and the page was an HTTPS page.

 

I created a "config" file and had this code...

<?php
define('ENVIRONMENT', 'development');
//define('ENVIRONMENT', 'production');

// Secure Web Server Root
define('SECURE_WEB_ROOT', ENVIRONMENT === 'development'
				? 'http://local.dev3/'
				: 'https://www.mysite.com/');
?>

 

 

Then in my page I had...

<div id="header">
	<a href="<?php echo WEB_ROOT ?>index.php">
		<img id="logo" src="<?php echo SECURE_WEB_ROOT ?>images/mylogo_200x50.png"
				 width="200" alt="My Logo" />
	</a>
</div>

 

 

Is there a better way to do this and eliminate my Config file which is no longer needed since I learned how to create a "Virtual Server"?

 

 

Debbie

 

Link to comment
Share on other sites

If you use relative paths for things like images you don't need to worry about the domain part of the url at all.

 

Upon reflection, if I am now using a virtual host then I shouldn't need to use any absolute paths and, as you mentioned, that should take care of my issue.

 

Thanks,

 

 

Debbie

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.