There was a problem loading the comments.

Redirects

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

Add a redirect

To add a redirect, perform the following actions:
  1. Select a redirect type from the Type menu.
    • Permanent (301) — This setting notifies the visitor’s browser to update its records.
    • Temporary (302) — This setting does not update the visitor’s bookmarks.
  2. Select a domain name from the menu, or select **All Public Domains** to redirect all of the domains that your cPanel account controls.
  3. In the next text box, enter the rest of the URL from which you wish for the server to redirect visitors. For example, if you wish to redirect http://example.com/directory.file.html to another URL, enter directory/file.htmlin this text box.
  4. In the Redirects to text box, enter the URL to which you wish to redirect users.
  5. Select one of the following settings:
    1. Only redirect with www. — This setting only redirects visitors who enter the www. prefix before the domain name part of the URL.
    2. Redirect with or without www. — This setting redirects all users, regardless of whether the visitor enters the www.prefix before the domain name part of the URL.
    3. Do Not Redirect www. — This setting does not redirect users who enter the www. prefix before the the domain name part of the URL.
  1. Select the Wild Card Redirect setting if you wish to redirect all files within a directory to the same filename in the new directory. For example, if you enable the Wild Card Redirect setting and example1.com redirects to example.com, then a visitor who tries to access the http://example1.com/pic.jpg URL redirects to the http://example.com/pic.jpgURL.
  2. Click Add.
  3. To test the redirect, click the link under Directory in the Current Redirects table. If you properly configured the redirect, the system directs you to the original domain.

Redirects via third-party applications

When you add a redirect with cPanel interface, the system places redirect rules at the bottom of the .htaccess file. Some third-party applications will ignore your rule because those applications only read rules and configurations that their section of the .htaccess file contains.

The following example displays the configuration that you must add to the top of the .htaccess file to add a redirect for the Drupal content management system. In this example:
  • drupal.user.example.com represents the URL to redirect.
  • http://cpanel.net/ represents the URL to which to redirect.

Redirects via third-party applications

When you add a redirect with cPanel interface, the system places redirect rules at the bottom of the .htaccess file. Some third-party applications will ignore your rule because those applications only read rules and configurations that their section of the .htaccess file contains.
Important:If you use a third-party application or content management system to add a redirect, such as WordPress®, the redirect may not function properly.
The following example displays the configuration that you must add to the top of the .htaccess file to add a redirect for the Drupal content management system. In this example:
  • drupal.user.example.com represents the URL to redirect.
  • http://cpanel.net/ represents the URL to which to redirect.
1
2
3
4
5
6
7
8
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{HTTP_HOST} ^drupal\.user\.example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.drupal\.user\.example\.com$
RewriteRule ^cptest$ "http\:\/\/cpanel\.net\/" [R=301,L]
</IfModule>

The Current Redirects table

The Current Redirects table lists the redirections that currently exist on your account. To search for a redirection, enter the search criteria in the Search text box and click Go.
The table lists the following information about redirects:
LabelDescription
DomainThe domain to redirect. ALL represents all of the account’s publicly-available domains.
DirectoryThe directory to redirect. Click the link to test the redirection.
Regular ExpressionThe system will redirect any URL that matches the regular expression in this column.
Redirect URLThe URL to which you wish to redirect users.
HTTP Status CodeThe numerical HTTP Status Code of the redirect.
Type
  • permanent — This setting notifies the visitor’s browser to update its records.
  • temporary — This setting does not update the visitor’s bookmarks.
Match www.Only redirect visitors who enter the www. prefix before the domain name part of the URL.
WildcardRedirect all files within a directory to the same filename in the new directory. For example, if you enable the Wild Card Redirect setting and example1.com redirects to example.com, then a visitor who tries to access the http://example1.com/pic.jpg URL redirects to the http://example.com/pic.jpg URL.

Share via
Did you find this article useful?  

Related Articles

© Bamboozle Web Services Inc.