Table of Contents
Creating a URL Redirect Rule
Using SiteWorx control panel, you can set up your .htaccess file to redirect a specific URL to a different URL. For example, if a visitor has bookmarked a specific page on your Web site, and you have since changed the file name for that page, the visitor will automatically be redirected to the correct page. This article provides information about commonly used redirect types and also provides instructions on setting up a redirect rule for your domain, via the SiteWorx control panel.
Notes
- Important: If you do not have experience in dealing with .htaccess files, we highly recommend that you contact support@nexcess.net for assistance. If handled incorrectly, an .htaccess file can cause major problems for your Web site!
- Always back up your .htaccess file before making changes to it.
Prerequisites
- An existing SiteWorx account.
- An enabled, global .htaccess file (redirects are available only in the global .htaccess file).
Redirect Types
The following table describes the most commonly used redirect types.
| Type | Code | Description |
|---|---|---|
| Permanent | 301 | Returns a permanent redirect status (301), indicating that the resource has moved permanently. |
| Temporary | 302 | Returns a temporary redirect status (302). This is the default. |
| See Other | 303 | Returns a "See Other" status (303), indicating that the resource has been replaced. |
| Gone | 410 | Returns a "Gone" status (410), indicating that the resource has been permanently removed. When this status is used, the URL argument should be omitted. |
Instructions
- Log in to your SiteWorx account.
- On the main menu, click Hosting Features > Htaccess.
- Under the Global Directory Options section, click the Redirects link.
- In the Redirect From box, enter the path, relative to the root directory, that you want to be redirected.
- In the Redirect To box, enter the absolute URL that you would like to redirect to.
For example, to redirect from "http://yourdomain.com/dir/oldfile.html" to "http://yourdomain.com/dir/newfile.html", you would specify the URLs, as follows:- Redirect From: /dir/oldfile.html
- Redirect To: http://yourdomain.com/dir/newfile.html
- From the Redirect Type drop-down list, select the redirect type for this redirect rule, and then click Add.
External Resources
- For information about additional redirect types, refer to the Apache documentation.
