Trouble turning off a redirect

Jelf

Active Member
Jun 26, 2016
36
4
58
Redmond
cPanel Access Level
Root Administrator
I had a simple .htaccess file to redirect domain #1 to domain #2. It worked fine.
I changed that .htaccess file to remove the redirect and restarted apache.
Yikes! The redirect is still happening.

Where else should I look on my server to turn off that redirect?
I have root access.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
13,382
2,107
363
cPanel Access Level
Root Administrator
Hey there! You don't need to restart Apache for changes to the .htaccess file as those files are read in real-time by the system.

However...do you happen to have nginx installed and running? That would cache the site data and would cause the redirect to continue to happen. If so, you can clear the cache for the domain right sidebar inside the account's cPanel interface.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
13,382
2,107
363
cPanel Access Level
Root Administrator
The first thing I would do is confirm it's not something in your local browser. If you have another browser, or a separate device like a phone or tablet, that would be the easiest thing to check.

If that still isn't working, I would try accessing the site with a Curl command to see what type of redirect is in place. For example, here is what we get when checking Google:

Code:
# curl https://google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="https://www.google.com/">here</A>.
</BODY></HTML>
That code shows us a 301 redirect happening.

I'd do that to confirm there is an actual redirect on the server-side still in place. If so, it's possible there is another .htaccess at /home/username causing confusion, instead of /home/username/public_html.
 

Jelf

Active Member
Jun 26, 2016
36
4
58
Redmond
cPanel Access Level
Root Administrator
Solved.
Turned out the problem was not a typical redirect.
Instead the domain at issue had the wrong 'document root'
The solution was to use cPanel > Domains.
I unassigned the domain at issue and then deleted the corresponding subdomain.
Then I was able to reassign the domain and use the correct directory.
 
  • Like
Reactions: cPRex