.htaccess ssl and "pretty URLS"

Permalink
Hi,
I have concrete setup to serve both http and https (ssl) pages. You can go to any page using either prefix.

However, I have to include index.php in the url in order for https to serve a page

Is there something that needs to be added to .htaccess to handle this?

I guess I'm looking for info on using pretty urls for ssl pages.

kstrange
View Replies:
jbx replied on at Permalink Reply
jbx
SSL should work with pretty URL's out of the box. Could you paste in what you have in your .htaccess file pls? Also, what is your BASE_URL set to in your config/site.php file?

Jon
kstrange replied on at Permalink Reply
kstrange
Here is my .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

and my base url is:
define('BASE_URL', 'http://ww2.retirementjobs.com');


I've also tried adding a BASE_URL_SSL and changing base redirect to false
kstrange replied on at Permalink Reply
kstrange
You can see a page here:
http://ww2.retirementjobs.com/career-resources/


but try changing it to
https://ww2.retirementjobs.com/career-resources/

and it's missing

But this works
https://ww2.retirementjobs.com/index.php/career-resources/
Brainakazariua replied on at Permalink Reply
Brainakazariua
Try this in your config/site.php

define two sets of base_url and dir_rel based on wether or not it's ssl

if(isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) {
   define('BASE_URL', 'https://site.com);
   define('DIR_REL','/dirname');
} else {
   define('BASE_URL', 'http://site.com);
   define('DIR_REL','/dirname');
}
jbx replied on at Permalink Reply
jbx
I'm actually thinking that maybe the .htaccess is not being read when in SSL.
The easiest way to check that is to put a typo in your .htaccess so that it is invalid. Then try visiting a pahe in both http and https. They should both give you a 500 internal server error. If the http one does and the https one doesn't, then your server isn't configured to read your .htaccess file in https. Have a word with your host about that...

Jon
kstrange replied on at Permalink Reply
kstrange
Yes, you are correct. it was a simple apache config issue. It's working perfectly - I shouldn't be playing with these things at 3am. LOL

Now, I just need to figure out how to keep all the links on a ssl page to point to http while in an SSL state.

We are executing an modal ecommerce transaction, which is the primary reason for needing an https page in which to call up the dialogue box.

I thought I read somewhere that this is possible, but will have to see....

Thank you very much for your assistance, much appreciated !!
Mnkras replied on at Permalink Reply
Mnkras
your forgot 2 ' so it should be

if(isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) {
   define('BASE_URL', 'https://site.com');
   define('DIR_REL','/dirname');
} else {
   define('BASE_URL', 'http://site.com');
   define('DIR_REL','/dirname');
}
kstrange replied on at Permalink Reply
kstrange
This is not necessary. But thank you for the suggestion, it is much appreciated.

It appears that Concrete works perfectly, out of the box, to be able to server either http or https to any page on the site.

My issue had to do with my apache config which wasn't setting a Directory for the 443 virtual server.