requirement of trailing slash in url for index.html

Discussion in 'Apache' started by jscjso, Jan 21, 2010.

  1. #1
    I have Apache 2.0.63.

    I read through the Apache related section on DirectorySlash, it says the default is "On". I even added my own line "DirectorySlash On" in my httpd as

    DirectoryIndex index.html index2.html
    DirectorySlash On

    I have an index.html in mydomain.com/abcde directory.

    When my site visitors type mydomain.com/adcde, it cannot find and display the index.html.

    When my site visitors type mydomain.com/adcde/, it works and shows the index.html in abcde diretory.

    I could not get this work without the trailing slash from Apache side.



    So I went off to explore the 301 redirect method and went nowhere. I use Perl as CGI and I was lost completely in this exploration. I created a .htaccess with "redirect 301 /abcde http://mydomain.com/abcde/"
    and put the .htaccess in the abcde directory. Nothing happens.

    Thank for your help
     
    jscjso, Jan 21, 2010 IP
  2. wgcom

    wgcom Peon

    Messages:
    157
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    did you try to put the .htaccess in root dir? not inside abcde.
     
    wgcom, Jan 21, 2010 IP
  3. jscjso

    jscjso Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the suggestion. I tried to have one at the root directory, then one at both locations, and only the abcde directory. All three cases do not make anything different.....not working.
     
    jscjso, Jan 22, 2010 IP