Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Weird behavior of Direct Admin
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Weird behavior of Direct Admin

I have been searching for a while but I cannot find an answer for my problem.

I created a subdomain and everything went well, directories were created properly and everything seems fine until I open the subdomain on my browser. I got an error, upon close inspection I notice that the subdomain is redirecting wrong.

instead of subdomain.domain.tld it is redirected to www.subdomain.domain.tld

I am an Nginx guy so adding subdomain is a piece of cake. So what happens? Why is that it is behaving that way?

I also uncheck the Force SSL with https redirect cause I thought this is the error.

Site Redirects are empty.

What did I do wrong @DA_Mark ?

Does anyone experience this? How did you fix it?

Comments

  • deankdeank Member, Troll

    I am reluctant to assist a traitor.

    Not that I've helped anyone on LET ever.

    Thanked by 1AlwaysSkint
  • @deank said:
    I am reluctant to assist a traitor.

    Not that I've helped anyone on LET ever.

    :(

  • Maybe non-www to www redirect is set in the control panel? :smile:

  • ViridWebViridWeb Member, Host Rep
    edited September 2020

    Check your redirection rules. Maybe you set something there

  • jarjar Patron Provider, Top Host, Veteran

    Probably the .htaccess file for your root domain which is followed in the sub domain because it’s document root is under the root, and htaccess is recursive.

  • @ViridWeb @jar @smtalk

    I only have a simple .htaccess script.

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    I forgot to mention. I use custom directory for the subdomain. I don't want to see my sudomain under the root domain directory.

    The root document path is
    /domains/domain.com/public_html

    The subdomain path is
    /domains/domain.com/subdomain.domain.com

    Thanked by 1jar
  • jarjar Patron Provider, Top Host, Veteran

    Interesting. Confirmed redirect via curl as well to rule out any browser oddities? Any chance a web app served there could be doing it?

  • @jar

    <!DOCTYPE html>



    404 Not Found

    >

    404

    >

    Not Found >

    >

    The resource requested could not be found on this server!

    >

    Not sure what happens. I still have this issue where my subdomain is being redirected to www.subdomain.domain.com

  • jarjar Patron Provider, Top Host, Veteran

    I'm thinking like a:

    curl -I subdomain.domain.com

    So like if I curl my site I see the redirect like:

    Jarlands-MacBook-Pro:~ jarlanddonnell$ curl -I http://mxroute.com
    HTTP/1.1 301 Moved Permanently
    Server: nginx
    Date: Sun, 27 Sep 2020 22:42:33 GMT
    Content-Type: text/html
    Content-Length: 162
    Connection: keep-alive
    Location: https://mxroute.com/
    

    Assuming you do as well, in which case it'll be time to dig deeper. If it's not user level and it's not htaccess, then I'm wondering if there's a global template customization on the server: https://help.directadmin.com/item.php?id=2

  • team_traitorteam_traitor Member
    edited September 2020

    @jar said: curl -I subdomain.domain.com

    I get this result

    HTTP/1.1 301 Moved Permanently
    Date: Sun, 27 Sep 2020 22:54:19 GMT
    Connection: keep-alive
    Set-Cookie: __cfduid=d00bf6fa0556b1875dea929794354c1be1601247259; expires=Tue, 27-Oct-20 22:54:19 GMT; path=/; domain=.nabasamo.com; HttpOnly; SameSite=Lax
    Location: https://dollys.nabasamo.com/
    Vary: User-Agent
    X-Turbo-Charged-By: LiteSpeed
    CF-Cache-Status: DYNAMIC
    cf-request-id: 05735f428d0000020a469a5200000001
    Server: cloudflare
    CF-RAY: 5d98ce4a7836020a-SIN
    
  • If change the ip address to my Nginx server it works fine. I have opened a ticket to my provider I would like to check what is the error since I cannot open it.

    Does DA have this behavior or just my browser messing with me? But how come my nginx server is fine? So weird. Hope @DA_Mark is active and checking this out.

    thanks @jar

    Thanked by 2seriesn ViridWeb
  • jarjar Patron Provider, Top Host, Veteran
    edited September 2020

    @team_traitor said: I get this result

    So that return suggests that the web server isn't doing a www redirect. That would suggest that either your web browser or web application is doing it. Sort of like how Wordpress will redirect to it's SITEURL value in the database, many web applications do that, some less obvious about where it's done than others.

    @team_traitor said: If change the ip address to my Nginx server it works fine

    Would that be that the subdomain is now pointing to a different web server in this case, and therefore not the same hosting data at all?

    @team_traitor said: Does DA have this behavior or just my browser messing with me?

    It does not.

    @team_traitor said: But how come my nginx server is fine?

    My theory is shifting to the idea that it's because it isn't serving an application that's redirecting to www. Web application redirect sounds highly likely at this point. That's the redirect that would occur after headers.

Sign In or Register to comment.