Redirects forward visitors (and search engines) from one URL to another. They are essential when you rename pages, change your domain, or restructure your site.
Creating Redirects in cPanel
Go to Domains > Redirects. Choose a redirect type, select your domain, enter the source path (e.g., /old-page), and enter the destination URL. Choose 301 (Permanent) for SEO-friendly redirects, or 302 (Temporary) if the change is short-term. Click Add.
Redirects via .htaccess
For more complex rules, add redirects directly to public_html/.htaccess:
# Redirect one page\nRedirect 301 /old-page https://yourdomain.com/new-page\n\n# Force www to non-www\nRewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]\nRewriteRule ^ https://%1%{REQUEST_URI} [R=301,L] Redirecting HTTP to HTTPS
To force all traffic to use HTTPS, add to your .htaccess:
RewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]