PR5 Link (6 months) if you can solve this apache issue... :)

Discussion in 'Apache' started by FikseGTS, Dec 5, 2006.

  1. #1
    I'm having issues where pages with trailing slashses are being loaded.

    the real page is:

    www.somewhere.com/nothere.html

    BUT, somehow the seach engines got a bad link, and they are indexing pages like:

    www.somewhere.com/nothere.html/whatever

    The URL above loads the nothere.html page instead of a 404 not found error and is causing duplicant content issues on the site.

    I would like to turn this feature off, but am using apache 1.37, and the AcceptPathInfo is only for 2.0 and later...

    how can I stop this from happening in apache 1.37?

    I would like apache to return 404 file not found instead of loading up the page...

    I'll put up a link to your site for a solid solution.... only clean links, no gambling, pron, etc....

    thanks!
     
    FikseGTS, Dec 5, 2006 IP
  2. amnezia

    amnezia Peon

    Messages:
    990
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    create a robots.txt

    and put in it

    User-agent: *
    Disallow: /nothere.html/whatever

    or if you have mod_rewrite installed you could use a rule like this

    rewriteRule ^nothere\.html/whatever$ http://www.somewhere.com/nothere.html [R=301,L]
     
    amnezia, Dec 5, 2006 IP
  3. amnezia

    amnezia Peon

    Messages:
    990
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #3
    the mod rewrite is probably the best because it will redirect visitors and search engine bots to the correct location using a permanent redirect.
     
    amnezia, Dec 5, 2006 IP
  4. FikseGTS

    FikseGTS Peon

    Messages:
    273
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks, but this needs to be a global solution, since the html pages, and the text that comes after the real html pages varires greatly....
     
    FikseGTS, Dec 5, 2006 IP
  5. amnezia

    amnezia Peon

    Messages:
    990
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #5
    well thats easy enough

    RewriteRule ^(.*)\.html/.*$ http://www.somewhere.com/$1.html [R=301,L]
     
    amnezia, Dec 6, 2006 IP
  6. FikseGTS

    FikseGTS Peon

    Messages:
    273
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    thanks amnezia, this seems to work very well...

    can you make an adjustment that would not depend on the .html extension?

    please PM me with the link....
     
    FikseGTS, Dec 6, 2006 IP
  7. amnezia

    amnezia Peon

    Messages:
    990
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #7
    what other extensions would need to be supported?
     
    amnezia, Dec 6, 2006 IP
  8. FikseGTS

    FikseGTS Peon

    Messages:
    273
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I just added another rule for the php files, working great, thanks for the assistance....
     
    FikseGTS, Dec 6, 2006 IP