#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    1
    Rep Power
    0
    I have a rewrite setup but it's getting the path incorrect. I have:
    domain.com/news/300.html

    to go to:

    domain.com/article.php?news_id=300

    but the problem is that it thinks that /news is part of the path for the images folder (e.g. domain.com/news/images instead of domain.com/images) so all my images break. It seems like it would just use the folder level that script was envoked by. Any ideas? Is this an Apache config or a rewrite error?
  2. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    You need EXTERNAL Redirect, not INTERNAL.

    Start here -> http://www.apache.org/docs/misc/rewriteguide.html and look under "Trailing Slash Problem".

    #############################################
    Solution:
    The solution to this subtle problem is to let the server add the trailing slash automatically. To do this correctly we have to use an external redirect,
    so the browser correctly requests subsequent images etc. If we only did a internal rewrite, this would only work for the directory page, but
    would go wrong when any images are included into this page with relative URLs, because the browser would request an in-lined object. For
    instance, a request for image.gif in /~quux/foo/index.html would become /~quux/image.gif without the external redirect!
    #############################################

IMN logo majestic logo threadwatch logo seochat tools logo