The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

/directory = /directory/

Discussion in 'General Discussion' started by strauberry, Jun 6, 2003.

  1. strauberry

    strauberry Well-Known Member

    Joined:
    Mar 25, 2003
    Messages:
    150
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    at the moment there's the following situation:

    http://IP-adress/folder -> no index-page
    http://IP-adress/folder/ -> index-page

    What must I configure to force apache to show the index-file in both cases??

    Thank you
    strauberry

    cPanel.net Support Ticket Number:
     
  2. rbmatt

    rbmatt Well-Known Member

    Joined:
    Oct 21, 2002
    Messages:
    212
    Likes Received:
    0
    Trophy Points:
    16
    We have tried some of the rewrites given in apache's manual, but it didnt work.

    cPanel.net Support Ticket Number:
     
  3. miki5

    miki5 Registered

    Joined:
    Jun 3, 2003
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    From Apache FAQ:

    Why does accessing directories only work when I include the trailing "/" (e.g., http://foo.domain.com/~user/) but not when I omit it (e.g., http://foo.domain.com/~user)?

    When you access a directory without a trailing "/", Apache needs to send what is called a redirect to the client to tell it to add the trailing slash. If it did not do so, relative URLs would not work properly. When it sends the redirect, it needs to know the name of the server so that it can include it in the redirect. There are two ways for Apache to find this out; either it can guess, or you can tell it. If your DNS is configured correctly, it can normally guess without any problems. If it is not, however, then you need to tell it.

    Add a ServerName directive to the config file to tell it what the domain name of the server is.

    cPanel.net Support Ticket Number:
     
  4. Faldran

    Faldran Well-Known Member

    Joined:
    May 28, 2002
    Messages:
    136
    Likes Received:
    0
    Trophy Points:
    16
    One possible solution is to change the following entry in httpd.conf:

    UseCanonicalName On

    To

    UseCanonicalName Off


    Any else try this? Any problems with it?

    cPanel.net Support Ticket Number:
     
  5. strauberry

    strauberry Well-Known Member

    Joined:
    Mar 25, 2003
    Messages:
    150
    Likes Received:
    0
    Trophy Points:
    16
    Hi Faldran,

    thank you, it works great :)

    strauberry

    cPanel.net Support Ticket Number:
     
  6. shacker23

    shacker23 Well-Known Member

    Joined:
    Feb 20, 2005
    Messages:
    263
    Likes Received:
    1
    Trophy Points:
    16
    Note that turning CanonicalName off also fixes the following problem in cPanel with add-on domains. If you have:

    maindomain.com
    otherdomain.com <-- add-on

    cPanel, in its bizarre logic, sets the "real" (Canonical) ServerName for otherdomain.com as otherdomain.maindomain.com. Where it gets weird for the public is this:

    You have a directory otherdomain.com/info. If you link to it with a trailing slash:

    http://otherdomain.com/info/

    it works fine. But if you link to it without trailing slash:

    http://otherdomain.com/info

    The user ends up looking at http://otherdomain.maindomain.com/info . The page is correct, but the URL is screwy and confusing. Turning CanonicalName off in that user's vhost fixes the problem. I think the folks at cPanel should consider doing this automatically for all add-on domains.
     
Loading...

Share This Page