1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Could .htaccess do this?

Discussion in 'Apache' started by cagintranet, Nov 10, 2005.

  1. #1
    when i goto my site with this url it doesnt work:
    pghsource.cagintranet.com/directory

    although when i add the slash at the end, it does:
    pghsource.cagintranet.com/directory/

    im guessing htaccess would solve my problem, but i dont know how to write that. any ideas?
     
    cagintranet, Nov 10, 2005 IP
  2. expat

    expat Stranger from a far land

    Messages:
    873
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I use it sometimes as se's may not send trailing slash

    # If requested resource does not exist as a file
    RewriteCond %{REQUEST_FILENAME} !-f
    # and does not end with a period followed by a filetype
    RewriteCond %{REQUEST_URI} !\..+$
    # and does not end with a slash
    RewriteCond %{REQUEST_URI} !/$
    # then add a trailing slash and redirect
    RewriteRule (.*)
    http://www.mydomain.com/$1/ [R=301,L]

    best of luck
    Expat
     
    expat, Nov 10, 2005 IP
  3. scottj

    scottj Peon

    Messages:
    168
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Check out apache's URL Rewriting Guide for some excellent tips on this topic:

    httpd.apache.org/docs/2.0/misc/rewriteguide.html
     
    scottj, Nov 10, 2005 IP