Enjoy unlimited access to all forum features for FREE! Optional upgrade available for extra perks.

Easiest way to edit https/SSL sites locally?

Joined
Jul 1, 2010
Posts
1,052
Reaction score
231
When making significant changes to any of my sites (mainly WordPress) I've always worked on them locally using WAMP.

Since having to introduce https to all the live sites I'm now struggling to edit them locally as my system doesn't currently have SSL so the sites don't work/display as expected.

I've done some research and tried a few methods using OpenSSL but have failed so far in getting something set up.

Is there an easy way to do it?

1) Ideally that supports Virtual Hosts
2) Ideally works automatically and doesn't need setting up separately for every site

or is there a way to just spoof the https instead of http? I don't need the sites to actually be encrypted, I just need the links to work, I'm fine with certificate errors

Thanks
 
I assume you you absolute URL's then, rather than relative?

Absolute URL example:
Code:
<a href="http://www.yourdomain.co.uk/some-page">some link</a>

Relative URL example:
Code:
<a href="/some-page">some link</a>

For external assets (CSS and Javascript) from a CDN, you can adjust the protocol part of the URL:
Instead of defining the protocol like this:

Code:
<script src="https://maxcdn.com/some-library/some-plugin.js"></script>

Just leave it out:
Code:
<script src="//maxcdn.com/some-library/some-plugin.js"></script>
 
Testing forms may cause an issue, testing local v.s. production environment.
If there is any other specific issue, post it here so we can maybe offer alternatives or work arounds.
 
Or use absolute URL's such as :

Code:
<a href="<?php echo home_url(); ?>/rest-of-url "> Something </a>

So it changes depending on Site URL. I personally use a staging plugin for small tweaks and to test plugin updates etc. Or have a subdomain where I deploy everything I need from there and then just upload the new database to the live and then doing a search and replace for all URL instances. Takes 10 mins max.

Some web hosts also provide a staging environment for that purpose.
 
Thanks for your responses guys.

Yes, it was the absolute paths that were causing the issue.

It seems I was actually really close to having it working when I posted this thread - it's working now.

Even though you can set up SSL on your own computer and load https pages, apparently because it is a self-signed certificate it still shows as 'Not Safe' in Chrome, and every time you click a link within the site you have to confirm to proceed, plus it won't load lots of stuff, like images or .css files with absolute paths.

The fix is a setting in Chrome which allows you to have unsafe https on localhost: chrome://flags/#allow-insecure-localhost

Once you activate that, you have to accept it is unsafe when you first load the site, but then everything loads as it should and no further warnings appear
 
Glad you sorted it.
 

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Featured Services

Sedo - it.com Premiums

IT.com

Premium Members

AucDom
UKBackorder
Be a Squirrel
Acorn Domains Merch
MariaBuy Marketplace

New Threads

Domain Forum Friends

Other domain-related communities we can recommend.

Our Mods' Businesses

Perfect
Service
Laskos
*the exceptional businesses of our esteemed moderators
Top Bottom