Using the inbuilt cPanel tools
If you’d prefer to add simple redirects, cPanel has an inbuilt redirect tool that will do this for you. If you want to do anything that is outside of the fairly basic functionality of the cPanel redirect tool, you may want to consider manually editing your .htaccess file to create more advanced redirects.Adding redirects manually
Your .htaccess files provide a means to make configuration changes in how directories/files route. With this file, you can redirect certain requests — such as forcing visitors to the “HTTPS” version of your site. This file is usually located in your public_html directory, as well as the root directory for any add-on or sub-domains. Redirects added this way should be placed at the top of your .htaccess file, as the file itself is read top-down. Here are a few of the most common uses of these types of redirects:Force your site to load securely
RewriteEngine OnRewriteCond %{HTTPS} !onRewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Rewrite a directory to be SSL/HTTPS access only
RewriteEngine OnRewriteCond %{SERVER_PORT} !443RewriteRule ^(.*)$ https://www.mywebsite.com/directory [R,L]
Rewrite a specific file in a directory to be SSL/HTTPS access only
RewriteEngine onRewriteCond %{SERVER_PORT} !443RewriteRule ^specificfile.php$ https://www.mywebsite.com/directory/specificfile.php [R=301,L]
Rewrite the URL to force visitors to ‘www.’
RewriteEngine OnRewriteCond %{HTTP_HOST} !^www.mywebsite.com [NC]RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [R=301,L]
Redirect any request for the root directory to forward to a subdirectory
RewriteEngine onRewriteCond %{HTTP_HOST} www.example.com [NC]RewriteCond $1 !^test/RewriteRule ^(.*)$ http://www.example.com/test/$1 [L]
Redirect ‘yourdomain.com’ to ‘subdomain.yourdomain.com’
Options +FollowSymLinksRewriteEngine OnRewriteCond %{HTTP_HOST} ^yourdomain.comRewriteRule ^directory(.*) http://subdomain.yourdomain.com$1 [R=301,L]
Redirect ‘www’ to ‘subdomain.yourdomain.com’
RewriteEngine onRewriteBase /RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]RewriteRule ^(.*) http://subdomain.yourdomain.com/$1 [R=301,L]