View Full Version : shared SSL and .htaccess

03-01-2006, 10:33 PM
I need (or at least really really want) to have a directory accessable via shared ssl only. I.e. https://westhost....com/mysite.com/fred should work, but mysite.com/fred should not.

I've tried a .htaccess with the SSLRequireSSL directive, but to no avail.

So, should this be working and/or is the another way to accomplish this and/or am I screwed?

Thanks in advance -


03-02-2006, 10:04 AM
I know that WestHost forces SSl for the Manager but they do not use .htaccess. If you log in via FTP and check the files in the manager directory you will see that they use a shell script to accomplish this. You might want to look into something like that.

Have you checked to see if .htaccess if working in the fred directory? If it is located in your public www root then it should be working i.e. /var/www/html/fred would make sure that .htaccess is available but if the directory is physically located someplace else it may not be. Not sure how you set that directory up.

I ran a test on one of my sites useing a .htaccess file in a directory and it actually returned a 500 error even when I tried accessing it with https.

I think that shared SSL works different then open SSL and that maybe this is not the correct thing to use with shared SSL. I tried finding some clue of this on the internet but had not luck. You might want to shoot a request off to support and ask them if perhaps they could at least lead you to an answer. I doubt they really support it but they may be able to give you some links. Make sure to let them know you have asked here in the forum already. Perhaps someone will come along that has more info but this may lead you to something.

It could be that mod_rewrite needs to be used for this but now sure what that would be. I did find this on the WebMaster (http://www.webmasterworld.com/forum92/600.htm) World site. Also check this page. How to use mod_rewrite to force SSL (http://faq.oneandone.co.uk/website_building/htaccess/mod_rewrite/2.html) I think that both need some tweaking to work with the WH set up of shared SSL since we access it via thier address but it may give you a start.

03-05-2006, 11:07 AM

Thanks much for your help and my apologies for the belatedness of that thanks...

Anyway - just an update - the SSLRequireSSL directive didn't work in .htaccess with openssl either - HOWEVER - it worked fine in the httpd.conf (which is preferred anyway). Finally, just for kicks, I tired the directive in httpd.conf with shared ssl... as you probably guessed, no dice.

Anyway, open-ssl did the trick!

Thanks again,


03-06-2006, 02:46 PM
Any chance of posting your httpd.conf edits here for the rest of us?

Thanks :-)