Portal Home > Knowledgebase > Articles Database > using htaccess to redirect from http to https. Please help!


using htaccess to redirect from http to https. Please help!




Posted by zomex, 06-16-2009, 06:43 PM
Hello everyone im wondering if there is anyway to redirect my users to https no matter what page they are on using htaccess? I really don't fancey using full url extentions and changing them on every link on my site. I can get the homepage to redirect to https but not any other. If there is no way to do this does anyone know the shortest hyperlink to use the redirect? Thanks a lot everyone! Jack

Posted by cybercast, 06-16-2009, 07:14 PM
Try this: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} It only works in APACHE web server.

Posted by zomex, 06-16-2009, 07:24 PM
Woo great progress my friend! That works on all my main pages but doesn't for my whmcs pages. Could I just create another htacess file with that code in my whmcs directory? Thanks mate huge help

Posted by cybercast, 06-16-2009, 07:25 PM
give it a try.

Posted by zomex, 06-16-2009, 07:34 PM
No luck that time for some reason. I also tried using this code for the htaccess in my whmcs folder. No luck with that one. Do you think it would work if i added both codes to the main htacess?

Posted by mugo, 06-17-2009, 05:15 AM
The directive pointing to your WHMCS folder probably has Allow Overrides set to "none" for .ht*

Posted by zomex, 06-17-2009, 07:42 AM
I see any idea how to fix that?

Posted by adminji, 06-17-2009, 08:08 AM
If you have root access to WHM, increase the value in WHM -> Tweak settings -> System -> "The maximum number of directories deep to look for .htaccess files when doing .htaccess checks. Can be from 0 to 100. 2 is the default setting. Values higher than this are discouraged." accordingly. This may help if whmcs directory is under two subdirectories of public_html.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
*****.net / *****.com (Views: 566)
server with online.net (Views: 603)