Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I need to add a trailing slash to the end of my aliases. If a user comes to: domain.com/test it must go to: domain.com/test/. I need this to be ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2008
    Posts
    9

    Add trailing slash


    Hi,

    I need to add a trailing slash to the end of my aliases.

    If a user comes to: domain.com/test it must go to: domain.com/test/. I need this to be done automatically and without a R=301 redirect, because in case of a redirect we will lose our params.

    Thanks,

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,916
    I assume this is apache?

    I always hated doing apache aliases. Doesn't apache just replace one matched string with another if you're using an alias? To include the trailing '/', you just add it to the end of the alias declaration, doncha? I could be wrong here, my knowledge of this is limited.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    wouldn't it just be
    Code:
    Alias /webfolder /var/www/path
    Alias /webfolder/ /var/www/path

    been a while, could also be if the directory is not browsable, make sure your options has indexing enabled in your virtual host
    Code:
    Options Indexes
    another thing could be if your apache conf doesn't specify the fqdn being used.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Dec 2008
    Posts
    9
    I don't want to make aliases for each of it. We have hundreds of them.

Posting Permissions

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