CyberHosting

Redirect HTTP (80) to HTTPS (443).

edited April 2018 in Tutorials

If you have successfully set up an SSL certificate for a domain, you will need to add a rewrite rule to that website in order to have it automatically forward to HTTPS instead of HTTP - otherwise you will have 2 versions, potentially damaging your SEO and encounter other issues.

To do this:

  1. Login to CyberPanel
  2. Select Websites on the left menu
  3. Choose the SSL enabled website from the list
  4. Select "Rewrite Rules" in the Configuration section
  5. Copy and paste the following code:
rewriteCond %{HTTPS} !on
rewriteCond %{HTTP:X-Forwarded-Proto} !https
rewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
  1. Now just save your changes, and you're done!

Comments

Sign In or Register to comment.
CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion