Problems, need help? Have a tip or advice? Post it here.
11 posts Page 1 of 2
hi, I have a website that is working fine with pretty URLs on ... now I'm trying to install the SSL certificate.

The webhost's instructions are to add this to the .htaccess file:
Code: Select all
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$$1 [R=301,L]

When I add that rule the site's SSL certificate becomes active but the site falls apart because when I view the source I can see that all the URLs are http:// - so no CSS files etc etc

When I uncomment K_SITE_URL in the config file to specify
Code: Select all
define( 'K_SITE_URL', '' );
the site becomes inaccessible because "the page isn't redirecting properly".

The same error - "the page isn't redirecting properly" - occurs if I remove the rewrite rule from .htaccess and add the K_SITE_URL in the config file as above.

I'm stumped ... anyone any ideas?

I guess the site is still running on an older version of Couch. Would that be correct?
I think upgrading to v2.0 should solve the issue.
@potato, the rewrite rule I use is a little different.
Code: Select all
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Check that some other rewrite is not contradicting the https rule, for instance the one where it requires or removes the www. Anywhere that http might be explicitly specified.

Go back to the state where you enable https but all of the internal links are incorrect. Figure out why. How do you specify the links in your template? are they hard coded? are you using <cms:show k_site_link />?

I have encountered these type of head scratchers, too, when initially setting up https. You just have to power through and get it sorted out. Also, don't forget the old venerable solution, clearing browser cache.
it's Couch 2.1 beta and I'm using <cms:show k_site_link /> - thanks Tim I'll try out your slightly different .htaccess rule. There are no other conflicting rules as far as I can tell ...
Adding to @Tim's suggestion about the browser's cache - in case caching is turned on in Couch config, please try turning it off (temporarily) and see if that helps.
Is Couch caching your content? Reset the cache. Turn off the computer. Clear browser cache. Log out and log back in. Try another browser on a different computer in a different location. Really. DNS can sometimes be strange and persistent. Take a break, go for a walk.

To see if you have hard-coded http links making trouble, download a database dump. Search the file for http://. Any non-secure links on your page - even to external pages - will throw security warnings, so you might as well look around and clean up while you've got your hands dirty.
it's a new day, a new dawn - same pesky problem ... thanks KK and Tim - I've followed your advice but have got nowhere.

Just wondering if K_SITE_URL isn't set how does Couch know what to use? I may have to go through the webhost support but I know they'll immediately point the finger at my installation - so I need to be prepared!

EDIT a bit more info - if I turn off pretty URLs and define K_SITE_URL the SSL functions OK - everything is using https://

But pretty URLs aren't pretty at all ... with K_SITE_URL defined I get the infinite loop and without K_SITE_URL defined I get http:// prefixes instead of https:// on the site URLs
@potato, please PM me the FTP+Couch access creds for the site and I'll take a look at the issue. Thanks.
Thanks for the creds, @potato.

I had a look and found that Couch was having trouble detecting HTTPS on your particular setup.
I made a change to its code to fix the problem (committed to GitHub but you don't need to apply it as I have done that for your site).

Please test and let me know if things are working as expected.
@KK - all working as expected with pretty URLs and https - as ever your help is much appreciated! :D
11 posts Page 1 of 2

Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 3 guests