In this article we will show you how to redirect your website to a new domain by using the .htaccess file

 

1. Create an empty text file using a text editor such as notepad, and save it as .htaccess

 

2. Edit the contents of the .htaccess file, with one of the following

 

301 – is used for a permanent redirect

Redirect 301 / http://example.com/

 

302 – is used for a temporary redirect

Redirect 302 / http://example.com/

 

3. Upload your .htaccess file that you have just made to the root folder of your domain