Question

How Can I Redirect 1 Https Domain To Another Https Domain

Hello everyone, Few days back i redirected my 1 Https domain to another new Https one for example

https://example.com to https://bmerk.com, The domain http://example.com was redirecting fine without the SSL https but when i would browse the old domain on https:// i wasnt redirecting to the new one, Can anyone help me out how this works? I am on Ubuntu using VestapCP.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello, @Zulqarnainkhan

At the moment you do not have a http to https redirection for your domain, meaning it will redirect only the https version to the other domain name.

In order to force your site to always load with https you can use the following rule in the .htaccess file:

#Force SSL
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Another rule you can use to redirect all the traffic from https://example.com to https://bmerk.com is using a rule like this one in your .htaccess file:

Redirect 301 / https://bmerk.com

Hope this helps

Regards, Alex