Worked well, glad to see this (I'm not htaccess-literate and wouldn't have known how to do this) as it greatly improves security.
Worked well, glad to see this (I'm not htaccess-literate and wouldn't have known how to do this) as it greatly improves security.
I'll have to try it out. Thank you so much for sharing this!
[URL="http://webhostcentral.net"]webhostcentral.net[url]
The only issue i have with this is when i put the .htaccess in my cron jobs stop working, as soon as the code is put into the .htaccess for redirect the cron jobs are gone. Is there something i can put in to prevent this happening?.
TM Hosting [ www.tmhosting.net ] -
A Canadian company providing services and support you deserve 24/7 around the clock.
*NEW* Now offering cPanel/WHM & DirectAdmin Hosting Solutions
- Try this untested code instead:
Btw, do you have an SSL cert currently installed?PHP Code:RewriteEngine on
Options +FollowSymlinks
#Rewrite the URL for WHMCS to always use https except for the whmcs/dl.php file
RewriteCond %{REQUEST_URI} !^/whmcs/admin/cron.php [NC]
RewriteCond %{REQUEST_URI} !^/whmcs/dl.php [NC]
RewriteCond %{REQUEST_URI} ^/whmcs/ [NC]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]
#Rewrite the URL for WHMCS dl area to always use http
RewriteCond %{REQUEST_URI} !^/whmcs/admin/cron.php [NC]
RewriteCond %{REQUEST_URI} ^/whmcs/dl.php [NC]
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
Hi, this was a great tip. I used it and it works great. My .htaccess file was blank. I downloaded it to my desktop, added the code, named the file ht.txt, uploaded it to my server, then renamed the file .htaccess. Made the mods in the config area, and it works great.
Thanks for the post. Things are getting better all the time.
TM Hosting [ www.tmhosting.net ] -
A Canadian company providing services and support you deserve 24/7 around the clock.
*NEW* Now offering cPanel/WHM & DirectAdmin Hosting Solutions
When i put a .htaccess file into my public_html i get a Internal Server Error 500 error in WHMCS
TM Hosting [ www.tmhosting.net ] -
A Canadian company providing services and support you deserve 24/7 around the clock.
*NEW* Now offering cPanel/WHM & DirectAdmin Hosting Solutions
Add each line in steps and see where the problem lies...
Start with this:
ThenPHP Code:RewriteEngine on
ThenPHP Code:RewriteEngine on
Options +FollowSymlinks
PHP Code:Then RewriteEngine on
Options +FollowSymlinks
#Rewrite the URL for WHMCS to always use https except for the whmcs/dl.php file
RewriteCond %{REQUEST_URI} !^/whmcs/admin/cron.php [NC]
RewriteCond %{REQUEST_URI} !^/whmcs/dl.php [NC]
RewriteCond %{REQUEST_URI} ^/whmcs/ [NC]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]
I get the error as soon as i create the .htaccess file
TM Hosting [ www.tmhosting.net ] -
A Canadian company providing services and support you deserve 24/7 around the clock.
*NEW* Now offering cPanel/WHM & DirectAdmin Hosting Solutions
I fixed it. Thanx for your help the mod worked.
TM Hosting [ www.tmhosting.net ] -
A Canadian company providing services and support you deserve 24/7 around the clock.
*NEW* Now offering cPanel/WHM & DirectAdmin Hosting Solutions
Care to post the fix so the next person with the htaccess problem knows what to do?
Can someone guide me how to use this on a sub-domain?
So that I can use it on http:// sub.domain.com
Regards,
Martin
Originally Posted by RPS;57608
[php
Is there non who can tell me (and others) how this can be done with a sub domain![]()
Assuming you therefore have your WHMCS in the 'root' of the sub-domain, I would guess that slight mod to the above should work ...
PHP Code:RewriteEngine on
Options +FollowSymlinks
#Rewrite the URL for WHMCS to always use https except for the whmcs/dl.php file
RewriteCond %{REQUEST_URI} !^/dl.php [NC]
RewriteCond %{REQUEST_URI} ^/ [NC]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://subdomain.domain.com/$1 [R=301,L]
#Rewrite the URL for WHMCS dl area to always use http
RewriteCond %{REQUEST_URI} ^/dl.php [NC]
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^(.*)$ http://subdomain.domain.com/$1 [R=301,L]