Jump to content

Redirect Issue


RPS

Recommended Posts

I would like to force https for everyone who tries to access WHMCS.

 

Assuming WHMCS is installed at http://www.domain.com/whmcs

 

The following htaccess code has worked for many months with another billing system, however, it spits out a 443 redirect error when I try to access the client side:

 

https://www.domain.com/whmcs/

 

However, the admin side works fine with the redirect

 

https://www.domain.com/whmcs/admin

 

I edited "Configuration > General > WHMCS System URL" to use https, then tried with just http

 

Then I did the same test trails for "WHMCS SSL System URL" and achieved the same result.

 

Here is my .htaccess code... (the same code works when I change the whmcs folder name to another folder)

 

# Rewrite the URL for billing to always use https PART 1
RewriteCond %{REQUEST_URI} ^/whmcs/ [NC]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]

# Rewrite the URL for billing to always use https PART 2
RewriteCond %{REQUEST_URI} ^/whmcs[NC]
RewriteCond %{REQUEST_URI} !^/whmcs/ [NC]
RewriteRule ^(.*)$ https://www.domain.com/$1/ [R=301,L]

Link to comment
Share on other sites

  • WHMCS CEO

When you have an SSL url entered into WHMCS, WHMCS will automatically do the redirect for you to SSL on pages containing any sensitive information and use non-SSL for pages that don't eg. knowledgebase, server status, etc... So you were putting in place a redirect that acts against the WHMCS one causing an invalid loop of redirects hence the error.

 

Matt

Link to comment
Share on other sites

The ideal situation is to have the entire whmcs install use SSL throughout the system. So the order page is SSL, the client area page is SSL, etc..

 

Matt, can you clarify how I can do this via WHMCS, or if I disable WHMCS redirection (by not inputting an https address), will what chickendippers said above hold true with the problems, or will WHMCS redirect correctly?

Link to comment
Share on other sites

  • WHMCS CEO

That's not the ideal situation - it's just a waste of resources - but if that's what you want to do, then you do exactly what you have done. WHMCS won't redirect at all if you leave the SSL System URL blank so no, what chickendippers said is not the case.

 

Matt

Link to comment
Share on other sites

  • WHMCS CEO
When my clients login to our website, I would much rather have the login pages secured. What extra resources do SSL connections take up? I'm not familiar with this...

Which is exactly what the WHMCS auto-switching does. It's pages that contain no sensitive information like announcements, knowledgebase, server status, etc... that are served in non-ssl.

 

Matt

Link to comment
Share on other sites

Which is exactly what the WHMCS auto-switching does

- Not for me... Pages with my install of WHMCS that contain login areas are not all protected. The login appears on just about every page I think, and it's on the left hand side. Is this a bug? Or just a misunderstanding regarding how it is supposed to work?

 

Thanks for clarifying that chicken :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated