Redirects allow you to make a specific web page redirect to another page and display the contents of that page. The redirection can be Temporary and Permanent:
- Temporary redirects send status code 302 to the browser that tells the browser not to save this redirect into its cached data. This is the recommended type of redirect unless you are absolutely sure that you will never change it in the future.
- Permanent redirects have a status code of 301 and unlike the temporal ones are cached in the browser memory.
You can redirect mydomain.com to mydomain.com/folder by following the next step:
- logging in your cPanel and click Redirects in Domains box.
- In ‘”Type” field, Select the type of redirects that you want to use.
- Choose the domain name and enter the URL that you would like to redirect.
- In the “redirect to” field, enter the URL to which you would like to redirect users.
- In the “www. redirection” field, Select whether to redirect with or without www. preceding the using the following options:
- When you select Only redirect with www, only users who type www in front of the page name will be redirected.
- When you select Redirect with or without www., you will redirect all users regardless of whether the www. prefix is included with the URL.
- When you select Do Not Redirect www., users who type www. with the URL will not be redirected.
- Click the Wild Card Redirect box if you wish to redirect all files within a directory to the same filename in the new directory.
- Example: When wild card redirects are active, if example1.com redirects to example.com, then a visitor trying to access example1.com/pic.jpgwill be redirected to example.com/pic.jpg.
- Click Add.
To remove an existing redirect:
- Click the X button corresponding to the redirect you would like to remove.
- Confirm that you would like to remove the redirect by clicking Yes. To keep the redirect, click No.