Results 1 to 7 of 7

Thread: cannot access directory's index file without a trailing slash

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2007
    Posts
    13

    Default cannot access directory's index file without a trailing slash

    For some reason, this does not work:

    mydomain/admin

    but this does work:

    mydomain/admin/

    Is there any way that I can fix this? Is it a setting somewhere in apache?

    I cannot post a link to a sample, but it is:
    www
    southmobilestreet
    com

  2. #2
    Member Newbie
    Join Date
    Oct 2006
    Posts
    46

    Default

    I'm not sure how you have the southmobilestreet.com domain defined, so it's a little difficult to say what may be the root of the problem. However, I do notice that going to southmobilestreet.com/admin redirects me to www.nsbundle.com/admin/ - which is unreachable. But, southmobilestreet.com/admin/ does reply from the southmobilestreet.com domain.

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2007
    Posts
    13

    Default The redirection is definitely the issue

    OK, that sheds some light on the subject.

    nsbundle.com is the main domain on the account.
    southmobilestreet.com and many others are parked on the account, and I have a php script using $_ENV['HTTP_HOST'] to run a sql query to determine which property (record) should be loaded.

    So the issue is the redirection itself.

    I do not know if that sheds any light on the issue. I do not know why it would redirect when there is no trailing slash. Any ideas?

  4. #4
    Junior Member Newbie
    Join Date
    Sep 2007
    Posts
    13

    Default Any clue why the redirect occurs?

    Anyone have any idea why this redirection would be occurring? I assume there is an apache setting somewhere, but I have no clue how to go about finding it.

    Any help would be appreciated. I know it seems minor, but many of my clients use the domain.com/admin link - we have been using it for years. I hate to think our tranfer to SPRY means this won't work. I understand that I have more control over services, and I like that. If anyone could provide some info on how to control this, it would be appreciated.

    Natan

  5. #5
    Member Newbie
    Join Date
    Oct 2006
    Posts
    46

    Default

    Again, without knowing the specifics of how you have defined the domain and action for /admin, or /admin/ I can't offer much good advice. However, if you have used the ScriptAlias directive in your apache configuration, make sure that the url target and the directory target both do not have trailing slashes, and that (along with a proper DirectoryIndex configuration) should allow both methods of access to work.

    If you've used some other method, or if this post doesn't make sense to you, please post the configuration sections related to the southmobilestreet.com domain and the /admin configuration.

  6. #6
    Senior Member Power Poster
    Join Date
    Dec 2007
    Posts
    359

    Default

    Most likely cause:

    A mod_rewrite, ErrorDocument, or ScriptAlias directive is pushing visitors who have not entered the trailing slash to a PHP script within the web root which, in turn, calls the header() function and specifies a new location.


    Recommended solution:

    Add ScriptAlias /admin /admin/ to your Apache config and ensure that no conflicting directives (or mod_rewrite rules) for the /admin/ directory appear in your Apache config or in any .htaccess files in your web root (if AllowOverride All is specified in your Apache config).

    Debug your PHP script by temporarily replacing header() calls with calls to die() to see the Location: values which are being specified.

  7. #7
    Junior Member Newbie
    Join Date
    Sep 2007
    Posts
    13

    Default

    I have set

    UseCanonicalName off

    this has fixed the problem of parked domains without trailing slashes being redirected to the master domain name.

    Are there any down sides to this?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •