Casbay Knowledge Base

Search our articles or browse by category below

HOW TO: Set up .htaccess redirect

Last modified: September 30, 2022
Estimated reading time: 1 min

Here is a step-by-step guide to set up .htaccess redirect:

1) Firstly, SETUP A REDIRECT.

  • log in to your Just Host cPanel account.
  • Click on the Redirects icon, which is located in the Domains section of the cPanel.

2) Then, CHOOSE 301 OR 302 REDIRECT.

  • From the Type menu, choose which type of redirect to use.
  • Permanent 301 redirects will update the visitor’s bookmarks and direct search engines to the new site.
  • Temporary 302 redirects will redirect the visitor or search engine, but will not update the bookmark and the search engine will continue to index to the original page.
  • Choose “Redirect 301” for a permanent redirect and “Redirect 302” for a temporary redirect. By default, the system will choose “Redirect 302”, if it is not otherwise specified.

3) After that, SET URL TO REDIRECT.

  • From the drop-down menu, choose your domain name you would like to redirect.
  • If you would like to redirect a single page or directory; just use the text field following the drop-down menu to enter the file name or folder name. 

4) Next, ENTER DESTINATION URL.

  • In the “redirects to ->” text field, please enter the full URL of the page you will be redirected to 
  • Enter the protocol as well, e.g. http://, https:// or ftp://

5) And afterwards, SELECT WWW REDIRECT OPTIONS.

  • Select whether you will be redirecting www. or not.
  • “Only redirect with www.” option will only redirect visitors that use www. as their part of the URL
  • “Redirect with or without www.” option will redirect all visitors.
  • “Do Not Redirect www.” option will not redirect visitors that use www. as their part of the URL
6) Last but not least, use the WILD CARD REDIRECT.
  • if you would like to redirect to the same file at the new destination, click the “Wild Card Redirect’ 
  • For example, from WWW.EXAMPLE.COM REDIRECTS to
    WWW.EXAMPLE-DESTINATION.COM
  • With “Wild Card Redirect”, www.example.com/about.html will redirect to www.example-destination.com/about.html
  • Without “Wild Card Redirect, www.example.com/about.html will redirect to www.example-destination.com
  • Create the redirect by clicking on the “Add” button 
  • If you are not hosting with us, or only have a domain name, you will need to redirect your domain name by updating the DNS.

You have done setting up the .htaccess redirect. For more articles, you can visit Knowledge Base.

Was this article helpful?
Dislike 0
Next: How to Fix Internal Server Error on Your WordPress