I can't remove permanent redirects in cPanel Redirects

zpnd

Registered
Jul 19, 2008
4
0
51
Hi,

There are a lot of permanent redirects in one of my customer's server. I tried to remove them through clicking the remove button but although it gave a "deleted" message, it failed to do so..

Are you sure you wish to permanently remove the redirect ** All Requests ** on ** All Public Domains **
I click YES and i got the message below.

The redirect ** All Requests ** on ** All Public Domains ** has been removed.
But redirect define is still there.

What should i do ? I can access to server via SSH. So may be i can handle with this just editing some file(s) ?
 

DaveUsedToWorkHere

Well-Known Member
Dec 28, 2001
686
1
318
Yes, I've done a bunch of testing and this doesn't appear to be an issue. Is the user over their disk quota by chance? If so, we won't write the .htaccess file for fear of corruption.
 

[email protected]

Registered
PartnerNOC
Apr 25, 2007
4
0
151
I have the same problem and .htaccess file under /public_html is empty. The mentioned redirect is like:

ALL /google.html Google permanent

And the cPanel version is:
cPanel 11.24.4-R36167 - WHM 11.24.2 - X 3.9

Any clue?
 

chillnet

Registered
May 28, 2020
1
0
1
South Africa
cPanel Access Level
Root Administrator
Yes, you can remove the redirects via SSH. Login to server and cd to directory /home/<user>/public_html/ directory and you will see the redirects in .htaccess files.
where, <user> is the actual username of the account.
I had a similar problem whilst transferring accounts from one server to the other. In my case there were multiple .htaccess files and thousands of redirect entries. I fixed it with running the following in the public_html folder of the account.

Code:
cd /home/<user>/public_html/
find . -type f -name '.htaccess' | xargs sed -i '/RedirectMatch/d'
Be careful though it will remove all entries in any .htaccess file where the RedirectMatch pattern is found.

But it worked for me and might be useful to someone else as well.