Setting up a web page redirection in Linux cPanel

Creating a web page redirect is quite straightforward. The easiest approach is to do it via your cPanel. Alternatively, you can achieve this by modifying your .htaccess file in the relevant directory.


How to configure a cPanel redirect


1. Log into your cPanel and locate "Redirects" under Domains




2. Enter the current directory in the first box


3. Enter the new directory in the second box


4. Select the type (temporary or permanent)


5. Click "Add" and you're all set!


To remove the redirect, simply choose the option on the same screen to delete it and you’re good to go! It's that simple!

How to set up a .htaccess redirect


CODERedirect 301 /example/test.html

http://www.yoursite.com/newlocation/newpage.html


Copy and paste this code into your .htaccess file. "Redirect 301" indicates that it is a permanent redirect. You can change it to "Redirect 302" for a temporary redirect. If no number is specified, it defaults to a temporary (302) redirect. Replace "/example/test.html" with your old location, and insert your new location where it states "http://www.yoursite.com/newlocation/newpage.html". You’re all done!


Both methods are quite simple and will effectively fulfill your needs.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.