Setting up redirects in your control panel

Step-by-step guide to creating redirects in cPanel and DirectAdmin control panels; the difference between 301 and 302 redirects, SEO impact, and fixing common errors.

6 min Updated 1 Aug 2026

Introduction: Why Are Redirects Vital for Your Website?

Imagine a user types an old link of your website into their browser, but the desired page has been moved to another address. Without a redirect, the user encounters a 404 error and will likely leave your site. A redirect is a server-side command that directs the browser or search engine to a new address. This not only improves user experience but also prevents SEO ranking drops. In this article, you will fully learn how to create 301 and 302 redirects in popular control panels like cPanel and DirectAdmin and understand the impact of each on SEO.

Difference Between 301 and 302 Redirects: Which One Should You Use?

Two common types of redirects on the web are HTTP status codes 301 and 302. Choosing incorrectly between these two can seriously harm your site's SEO.

301 Redirect (Moved Permanently)

This redirect informs search engines that the old page has been permanently moved to a new address. All SEO credit (PageRank, backlinks, and link equity) is transferred from the old address to the new one. Use cases:

  • Changing the main domain of the site (e.g., from example.com to example.net)
  • Deleting a page and replacing it with similar content
  • Consolidating www and non-www versions (e.g., redirecting example.com to www.example.com)
  • Changing URL structure (e.g., from /old-page to /new-page)

302 Redirect (Found / Moved Temporarily)

This redirect tells search engines that the move is temporary and the original page still exists. SEO credit is not transferred to the new address, and the search engine continues to index the old address. Use cases:

  • Seasonal or temporary promotional pages (e.g., Nowruz discounts)
  • A/B testing of pages (temporary content changes)
  • Temporary maintenance or updates of a page
  • Redirecting users to a login page after authentication

Important Note: If you mistakenly use a 302 redirect for a permanent move, search engines will retain the credit of the old page, and your ranking may drop. Always carefully choose the type before creating a redirect.

Creating a Redirect in cPanel Control Panel

cPanel is one of the most popular hosting control panels. To create a redirect in cPanel, follow these steps:

Step 1: Access the Redirects Section

  1. Log into cPanel (usually via yourdomain.com/cpanel).
  2. In the Domains section, find and click on Redirects.

Step 2: Configure the Redirect

On the Redirects page, configure the following options:

  • Type: Select the redirect type: Permanent (301) or Temporary (302).
  • Redirects From: Enter the source page address. You can use a specific domain or a path. For example, /old-page.
  • Redirects To: Enter the destination address. For example, https://www.yourdomain.com/new-page.
  • Wild Card Redirect: If you want all subpaths of a domain to be redirected to another domain, enable this option. For example, redirecting old.com/any-page to new.com/any-page.

Step 3: Save and Test

After clicking Add, the redirect is created. To test, use tools like curl -I yourdomain.com/old-page in the terminal. The output should include status code 301 or 302.

Common Mistake: Many users forget not to include the protocol (http/https) in the "Redirects From" field. cPanel automatically adds the protocol, but if you enter the full address with https, the redirect may not work correctly.

Creating a Redirect in DirectAdmin Control Panel

DirectAdmin is also a powerful control panel. The method for creating a redirect is slightly different:

Step 1: Access the Custom HTTPD Configurations Section

  1. Log into DirectAdmin.
  2. Go to Advanced Features and select Custom HTTPD Configurations.

Step 2: Add the Redirect Code

In this section, you need to manually add the redirect code to the Apache configuration file. For a 301 redirect, use the following code:

RewriteEngine On
RewriteRule ^old-page$ /new-page [R=301,L]

For a 302 redirect, change 301 to 302. You can also use the simpler method with Redirect:

Redirect 301 /old-page https://www.yourdomain.com/new-page

Step 3: Save and Apply Changes

After saving the file, you need to restart Apache. In DirectAdmin, there is usually a Restart Apache option at the bottom of the page. If not, run the command service httpd restart via SSH.

Note: If you are using DirectAdmin and encounter a 500 error, your redirect code is likely incorrect. Ensure the paths are correct and use forward slashes (/).

Impact of Redirects on SEO: Common Mistakes and Solutions

Redirects have a direct impact on your site's SEO. Here are some key points and common mistakes:

Mistake 1: Using a 302 Redirect for a Permanent Move

As mentioned, a 302 redirect does not transfer SEO credit. If you have permanently deleted a page, be sure to use 301. Otherwise, the search engine will still index the old page, and your ranking may drop.

Mistake 2: Creating a Redirect Chain

A redirect chain occurs when one address redirects to another, and then to a third. For example, A → B → C. This reduces loading speed and loses some SEO credit. Always try to set redirects directly to the final destination.

Mistake 3: Redirecting to a 404 Page or Error

If the destination page does not exist, the user encounters a 404 error. Before creating a redirect, ensure the destination address exists.

Solution: Use Redirect Testing Tools

To check the correctness of redirects, use online tools like Redirect Checker or the curl command in the terminal. Example:

curl -I https://yourdomain.com/old-page

The output should include the status code 301 or 302 and the destination address.

Domain Redirect vs. Path Redirect

Two other common types of redirects are domain redirects and path redirects:

Domain Redirect

This type redirects an entire domain to another domain. For example, redirecting old-domain.com to new-domain.com. In cPanel, you can do this by selecting the source domain and entering the destination domain in the Redirects section. In DirectAdmin, use the following code in the configuration file:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^old-domain\.com$ [NC]
RewriteRule ^(.*)$ https://new-domain.com/$1 [R=301,L]

Path Redirect

This type redirects only a specific path to another path. For example, redirecting /old-page to /new-page. This is easily done in both control panels.

Note: If you plan to change your domain, be sure to use a 301 redirect and redirect all old pages to their equivalents on the new domain. Also, register the new address in Google Search Console.

Summary and Final Recommendation

Redirects are powerful tools for managing website changes, but incorrect use can harm SEO and user experience. Always carefully choose the type (301 or 302) before creating a redirect and ensure the destination address is correct. If you use cPanel or DirectAdmin control panels, follow the steps outlined in this article. To test redirects, use online tools or the curl command. Finally, if you need expert advice, the ServerNet support team can guide you in this area.

Was this page helpful?