How to redirect a URL using .htaccess?

Posted by Sakshita

Redirect a URL using .htaccess

We all know that .htaccess file is one of the hidden files in cPanel that allows user to manage several task related to website, that is why this file is important.
One can do several task related to website like redirection by editing simple codes in this file.
So, today in this article I will share the procedure with which you can redirect any URL using .htaccess file.
Redirection of URL
Follow the below mentioned steps to redirect any URL.
  • Login to cPanel.
  • Get inside the File Manager section and then inside domain directory.
cPanel interface of REDSERVERHOST
  • Get into the domain directory of which you want to redirect the URL.
  • Right click over .htaccess file and then click over Edit.
File Manager
  • Now, add the given code in the file.
redirect301 /https://example.com

*Replace example.com with the domain to which you want to redirect a perticular URL.

  • Now, click over Save Changes button to save the redirection.
Thus, you have successfully redirect a URL by using .htaccess file.

Hope this may help you to add redirection to any URL. 

Cheap Web Hosting                                   Best Web Hosting For Startup

Comments