Redirecting a site can be done from the cPanel control panel in the Redirects category or from the .htaccess file.

Option 1 (from cPanel):

I. Log in to cPanel in the Domains -> Redirects category

The redirect type can be Permanent (301) or Temporary (302), this setting specifies how search engines interpret the redirect, including Google.

2. Choose the desired domain or use redirection for the entire account (** All Public Domains **).

3. To redirect www. there are 3 options:

- Only redirect with www. - redirects only if the page starts with www.
- Redirect with or without www. - redirects regardless of whether www appears. or not
- Do Not Redirect www. - redirects only if the domain is without www.


II. Option 2 (from .htacces)

To redirect my.tld domain to www.my.domain, enter the code below in the .htaccess file:

Options + FollowSymLinks
RewriteEngine on
RewriteCond% {HTTP_HOST}! ^ Www \.
RewriteRule (. *) Http: //www.mydomain.tld/$1 [R = 301, L]

Replace "my.tld domain" with your domain as appropriate.

 

War diese Antwort hilfreich? 0 Benutzer fanden dies hilfreich (1 Stimmen)