Redirect in cpanel with several wordpress sites


Active Member
Dec 29, 2013
cPanel Access Level
Website Owner
Hi, I have four wordpress on one domain name. I'm moving one to another domain name.

Example wordpress site would redirect to a new domain name. wordpress site would not forward wordpress site would not forward wordpress site would not forward is in maintenance mode and will deleted soon. Are there tools in cpanel that could help me do this type of redirect?

Thank you for your time
Last edited by a moderator:


Well-Known Member
May 28, 2022
Mansfield, Nottingham, UK
cPanel Access Level
Root Administrator
You'll want a .htaccess rule in Apache to setup these rewrites.

I think this should do the job:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/folder(1|2|3)/  [NC]
RewriteRule ^(.*)$$1 [R=301,L,NC]
(tested on )

In order:
1. RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] indicates to match the hostname to only (NC=not case sensitive)
2. RewriteCond %{REQUEST_URI} !^/folder(1|2|3)/ [NC] says if the Request URL does NOT (the exclamation mark) start with (the caret ^ character) the text "folder1" or "folder2" or "folder3" (folder(1|2|3) is an expression meaning any of those numbers could follow the word folder) followed by a forward slash , then continue.
3. RewriteRule ^(.*)$$1 [R=301,L,NC] redirect the full url (^(.*)$) to followed by the captured url ($1) using a 301 Permanent redirect message, not case sensitive and make this the Last rule in the set.

Alternatively, there's:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/folder1/  [NC,L]
RewriteCond %{REQUEST_URI} !^/folder2/  [NC,L]
RewriteCond %{REQUEST_URI} !^/folder3/  [NC,L]
RewriteRule ^(.*)$$1 [R=301,L,NC]
Which goes:
1. RewriteCond %{REQUEST_URI} !^/folder1/ [NC,L] : if the URL does NOT start with folder1 (not case sensitive), then make this this Last part of this rewrite match.
2,3 4: I'll leave you to work out those bits yourself :)
5: RewriteRule ^(.*)$$1 [R=301,L,NC] if none of the previous rules have caused a match, then redirect.

(tested on )

You might find Apache's Rewrite manual page a useful reference.
  • Like
Reactions: cPRex