Set a directory as the DefaultType?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kingofkolt

    Set a directory as the DefaultType?

    I have an annoying problem. Every time I try to access a folder on my server
    (Apache) without adding a slash at the end, I get a "page cannot be
    displayed" message. For example, on my server I have a folder within htdocs
    called "ct", and I want to access the index.php page in it from the address
    http://localhost/ct. But when I try that, it gives me the "page cannot be
    displayed" message. So I have to type http://localhost/ct/ (with a forward
    slash / at the end). It's not a big deal but it is an annoyance and if I
    ever run my own server I would like to know how to fix that.

    I wonder if maybe setting the DefaultType directive to a directory is the
    way to go? And if so, what's the MIME type for a directory?

    Thanks
    - JP


  • Shane Lahey

    #2
    Re: Set a directory as the DefaultType?

    On Thu, 27 May 2004 21:05:53 GMT, "kingofkolt "
    <jessepNOSPAM@c omcast.net> wrote:
    [color=blue]
    >I have an annoying problem. Every time I try to access a folder on my server
    >(Apache) without adding a slash at the end, I get a "page cannot be
    >displayed" message. For example, on my server I have a folder within htdocs
    >called "ct", and I want to access the index.php page in it from the address
    >http://localhost/ct. But when I try that, it gives me the "page cannot be
    >displayed" message. So I have to type http://localhost/ct/ (with a forward
    >slash / at the end). It's not a big deal but it is an annoyance and if I
    >ever run my own server I would like to know how to fix that.
    >
    >I wonder if maybe setting the DefaultType directive to a directory is the
    >way to go? And if so, what's the MIME type for a directory?
    >
    >Thanks
    >- JP
    >[/color]

    has to do with your httpd.conf (apache configuration if that's what
    your using)

    Example:

    # NOTICE THERE IS NO TRAILING / in the PATH

    DocumentRoot "/var/www/htdocs"
    <Directory "/var/www/htdocs">
    # insert your options here....
    </Directory>


    Comment

    • Andy Hassall

      #3
      Re: Set a directory as the DefaultType?

      On Thu, 27 May 2004 21:05:53 GMT, "kingofkolt " <jessepNOSPAM@c omcast.net>
      wrote:
      [color=blue]
      >I have an annoying problem. Every time I try to access a folder on my server
      >(Apache) without adding a slash at the end, I get a "page cannot be
      >displayed" message. For example, on my server I have a folder within htdocs
      >called "ct", and I want to access the index.php page in it from the address
      >http://localhost/ct. But when I try that, it gives me the "page cannot be
      >displayed" message. So I have to type http://localhost/ct/ (with a forward
      >slash / at the end). It's not a big deal but it is an annoyance and if I
      >ever run my own server I would like to know how to fix that.[/color]

      Do you have UseCanonicalNam e turned on, and ServerName set to something that
      doesn't resolve? That would cause this behaviour, as it does a redirect when
      you don't supply the trailing space.

      [ Offtopic for this group; it's an Apache configuration issue. ]

      --
      Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
      http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space

      Comment

      • kingofkolt

        #4
        Re: Set a directory as the DefaultType?

        "Andy Hassall" <andy@andyh.co. uk> wrote in message
        news:otmcb0h3o1 4j3dfbc2mqpbg0a t16rufkfi@4ax.c om...[color=blue]
        > On Thu, 27 May 2004 21:05:53 GMT, "kingofkolt " <jessepNOSPAM@c omcast.net>
        > wrote:
        >[color=green]
        > >I have an annoying problem. Every time I try to access a folder on my[/color][/color]
        server[color=blue][color=green]
        > >(Apache) without adding a slash at the end, I get a "page cannot be
        > >displayed" message. For example, on my server I have a folder within[/color][/color]
        htdocs[color=blue][color=green]
        > >called "ct", and I want to access the index.php page in it from the[/color][/color]
        address[color=blue][color=green]
        > >http://localhost/ct. But when I try that, it gives me the "page cannot be
        > >displayed" message. So I have to type http://localhost/ct/ (with a[/color][/color]
        forward[color=blue][color=green]
        > >slash / at the end). It's not a big deal but it is an annoyance and if I
        > >ever run my own server I would like to know how to fix that.[/color]
        >
        > Do you have UseCanonicalNam e turned on, and ServerName set to something[/color]
        that[color=blue]
        > doesn't resolve? That would cause this behaviour, as it does a redirect[/color]
        when[color=blue]
        > you don't supply the trailing space.
        >
        > [ Offtopic for this group; it's an Apache configuration issue. ]
        >
        > --
        > Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
        > http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space[/color]

        You nailed it. Thanks for the help.

        - JP


        Comment

        • Shane Lahey

          #5
          Re: Set a directory as the DefaultType?

          On Thu, 27 May 2004 21:29:21 GMT, "kingofkolt "
          <jessepNOSPAM@c omcast.net> wrote:
          [color=blue]
          >You nailed it. Thanks for the help.
          >
          >- JP
          >[/color]

          smarty pants :(


          ...
          ... never had this problem myself though :D ..

          Comment

          Working...