How to Configure Redirects Manually in cPanel Using .htaccess

This guide explains when and why you should configure redirects manually in your .htaccess file, how to access and edit the file in cPanel, and provides clear examples of 301, 302, and CMS‑specific redirects such as Drupal. Manual redirects are essential when third‑party applications override or ignore cPanel’s default redirect rules.

manual redirects cPanelhtaccess redirect rules301 302 redirect examples

~2 min read • Updated Feb 18, 2026

1. Overview


A redirect automatically sends users from one URL to another. While cPanel’s Redirects interface is usually sufficient, some applications require manual configuration inside the .htaccess file.


2. When Manual Redirects Are Necessary


Manual redirects may be required in the following situations:


  • A third‑party application only reads rules inside its own .htaccess block.
  • A CMS (such as WordPress) overrides or conflicts with redirects created in cPanel.
  • Redirects fail due to rule order or application‑specific requirements.

3. How to Edit Your .htaccess File


To manually edit your .htaccess file, follow these steps:


  1. Open cPanel → File Manager.
  2. Click Settings in the top-right corner.
  3. Enable Show Hidden Files (dotfiles).
  4. Click Save.
  5. Locate the .htaccess file inside the public_html directory.

You can now edit the file directly using File Manager’s built‑in editor.


4. Examples of Manual Redirects


4.1 301 Permanent Redirects


Redirect an entire site:

Redirect 301 / http://example.com/

Redirect a single page:

Redirect 301 /original.html http://www.example.com/new.html

Redirect a directory:

Redirect 301 /old-directory http://www.example.com/new-directory

4.2 302 Temporary Redirects


Temporary redirect for an entire site:

Redirect 302 / http://example.com/

Temporary redirect for a page:

Redirect 302 /original.html http://www.example.com/new.html

Temporary redirect for a directory:

Redirect 302 /old-directory http://www.example.com/new-directory

4.3 Drupal Redirect Example


Some CMS platforms, such as Drupal, require redirect rules to be placed at the top of the .htaccess file. Example:


<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>

In this example:

  • drupal.user.example.com is the URL being redirected.
  • http://cpanel.net/ is the destination URL.

5. Conclusion


Manual redirects give you full control over URL behavior, especially when working with CMS platforms or applications that override cPanel’s default redirect rules. By editing your .htaccess file directly, you can ensure your redirects function exactly as intended.


Written & researched by Dr. Shahin Siami