Rewrite domain on Linux hosting to redirect one domain to another

Linux HostingI transitioned from a Windows based host to a Linux based one last year when I changed web host. I had a reasonable understanding of redirecting one domain to another on the Windows host, but am now having to learn how to do it on Linux hosting.

I’ve tried doing it through the front-end cPanel controls, but find that it enver works. The most recent one I;’ve tried setting up, I spoke to the support team and they gave me the .htaccess settings for the redirect.

I am posting it here so that I can easily find it in future.

I was wanting a redirect from https://dev.azrcrv.co.uk/ to https://development.azurecurve.co.uk/ to make short URLs available (or at least shorter URLs available). The below needs to be added to the .htaccess of the website on the domain you want to redirect:

#Redirect from old domain to new domain
RewriteEngine on
RewriteBase /
RewriteRule (.*) https://development.azurecurve.co.uk/$1 [R=301,L]

Replace the highlighted domain with the one you want to redirect.

What should we write about next?

If there is a topic which fits the typical ones of this site, which you would like to see me write about, please use the form, below, to submit your idea.

Your Name

Your Email

Suggested Topic

Suggestion Details

1 thought on “Rewrite domain on Linux hosting to redirect one domain to another

Leave a Reply

Your email address will not be published. Required fields are marked *