Could someone explain aliasdomains and redirects, please - not getting the desired results

Discussion in 'General' started by jnewman67, Nov 24, 2021.

  1. jnewman67

    jnewman67 Active Member HowtoForge Supporter

    CentOS 8, ISPConfig 3.2.6, working production server
    My previous hosting control panel did not do aliasdomains (not implemented), so I've always just had an index.htm that was a simple redirect to the desired domain. Worked, and none of the sites ever required anything overly technical, so problem solved.
    I thought I'd actually step up my game and NOT do it that way if ISPConfig could handle them - and apparently it can, I have a couple working. But they don't behave the way I'd like, or think they should.
    In my mind, there are two goals - either masquerading AS one domain under a differnet domain, or jumping FROM one domain to another domain. My previous mechanism did the later - type in myaliasdomain.com and you'd end up on myrealdomain.com. I can't seem to get ISPConfig to do this, nor do I know if it actually SHOULD do this, or was intended to be able to do this.
    So I'm wondering if someone would take a few minutes and explain the different "redirect" mechanisms that ISPConfig offers (and maybe mention how the other flags/options affect these) in less technical, more examplish, detail. All of the descriptions I've found elsewhere devolve into rule following, error codes, blah, blah - but they don't describe the actual event or desired outcome very well, and mapping it back to what ISPConfig actually does isn't clear to me.
    I did look at the manual, and it describes it in mostly the same way, so not very helpful to someone not experienced with it. I also did some trial/error testing, but got mixed results that never got me the desired outcome.
    Thank you.
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    It's up to you wether you want to redirect to a different domain or just show the same site.

    Simply open the settings for the alias domain, set "Redirect type" to "R (Temporary redirect)" and "Redirect path" to the domain it should go to, e.g. "https://www.example.com".
     
  3. jnewman67

    jnewman67 Active Member HowtoForge Supporter

    Thank you for the response.
    You know how when you know you should know something, but you don't and you don't know what specific words you need to use to either look it up or ask someone about it? That's the issue I'm having.
    Part of the problem is that the definition uses the word being defined in the definition (redirect):
    so the "temporary redirect" is URL substitution - go here instead, if the URL is supplied. go somewhere else if it's not (why one would do that if it's not supplied is breaking my brain, but i'm ignoring that for now).
    So I've done as you said, but it's not working - fully anyway. Some details:
    main domain = jerrycallen.com, alias domain = geraldcallen.com
    (these are live domains, both ISPConfig hosted (same server), nothing there to see other than "hello" index.htm)​
    alias settings:
    [​IMG]
    you can see it's redirecting to an HTTP:// location as directed in your response.
    This is how that looks in Chrome initially
    [​IMG]
    this is the result when the page stops loading
    [​IMG]
    and if you click on the URL, you'll see it was trying to load the HTTPS:// version
    [​IMG]
    if you manually remove the S, then the page actually loads
    [​IMG]

    in this instance, HTTPS isn't an option because CentOS 6 and Lets Encrypt aren't playing nicely any longer (yes, i'm moving away). but it's not clear how the HTTPS is getting inserted in there to begin with. Firefox does the same thing:
    [​IMG]
    here is the header information from Firefox:
    GET / undefined
    Host: jerrycallen.com
    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
    Accept-Language: en-US,en;q=0.5
    Accept-Encoding: gzip, deflate, br
    DNT: 1
    Connection: keep-alive
    Upgrade-Insecure-Requests: 1
    Sec-Fetch-Dest: document
    Sec-Fetch-Mode: navigate
    Sec-Fetch-Site: cross-site​
    are the browsers seeing the HTTP:// and ignoring it and trying to run just the URL through their loading mechanism, which then defaults to using HTTPS by default? or is the HTTP getting stripped off before sending the URL?
    here's a chunk of the jerrycallen.com.vhost file:
    ServerAlias geraldcallen.com
    ...
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^geraldcallen\.com$ [NC]
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
    RewriteRule ^/(.*)$ https://jerrycallen.com/$1 [R]

    so maybe the rewrite rule is forcing HTTPS by default?
    oh, and by the way, playing with these aliasdomains has once again caused httpd to crash, leaving a ghost process running, serving pages.
    another server restart to fix it - stopping/restarting does nothing but fail (could not bind to socket)
     
  4. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    In your first post you stated you were using CentOS 8, but you are using CentOS 6? Please update to a supported version first...
     
  5. jnewman67

    jnewman67 Active Member HowtoForge Supporter

    Sorry if the images aren't showing, i'll see if i can figure that out.
    i'm actually using both - 2 servers - i've been trying to implement aliasdomains on both. the above came from the CentOS 6 server because that's where I had some domains that weren't in use yet and could be used for testing. I started on the CentOS 8 server when I created the OP, which by the way, was just a request for a description, in layman's terms, of what the different ISPConfig redirect options were, and how they should be expected to function. - what they actually do. Maybe if we start over on that, we won't have to get into the weeds of what's not working for me right now. And if there is still a situation later that doesn't seem to be working correctly, i'll be in a better position to narrow it down and talk more precisely about it.
    Thank you for the help.
     

Share This Page