Yet (another) htacess problem |
[eluser]JonoB[/eluser]
Trying to set up a CI install on a sub-domain. application/config/config.php: Code: $config['base_url'] = 'http://testing.mysite.com'; .htaccess file: Code: <IfModule mod_rewrite.c> This works perfectly. However, I want everything to run on SSL. So the following is changed in config.php: Code: $config['base_url'] = 'https://testing.mysite.com'; And I add the following lines to the end of the htaccess file: Code: RewriteCond %{HTTPS} off And then I get a 404 (not a CI 404). Any ideas?
[eluser]JonoB[/eluser]
I have also tried only changing the base_url to use https, and not changing the htaccess (i.e. no SSL redirect in htaccess), with the same result.
[eluser]CroNiX[/eluser]
base_url needs a trailing slash after .com. http://testing.mysite.com/ Your SSL directives should be at the top of your htaccess file, above the CI rules. Otherwise, the request goes straight to CI and the SSL rewrite directives never get used. They get processed in order.
[eluser]JonoB[/eluser]
Thanks for the response Adding a trailing slash to base_url (i.e. http://testing.mysite.com/) seems to work fine. However, if I change the base_url to https://testing.mysite.com/ (without adding any ssl rewrites to htaccess), then I get a 404 I have also tried setting the base_url = '' - in this case http://testing.mysite.com works fine, and https://testing.mysite.com still gives a 404
[eluser]JonoB[/eluser]
Right, so it seems that a virtualhost has to be added to httpd.conf for each subdomain that is to run SSL. Hope this helps someone else out at some point in the future... |
Welcome Guest, Not a member yet? Register Sign In |