Images Not Working when I Add .htaccess Rewrite

Discussion in 'Apache' started by Curtis Hunter, Feb 14, 2010.

  1. #1
    Hey guys, I'm having a problem with my images after I add the following htaccess to my website:

    RewriteEngine On
    RewriteRule ^([a-z]+)/?$ ../$1.php [NC,L]
    Code (markup):
    It works in terms of making a clean url, such as when I type in mywebsite.com/demo it will go to mywebsite.com/demo.php

    However, the images on the page when I go to mywebsite.com/demo won't work because it believe that the files are in:

    mywebsite.com/demo/images/image.jpg
    INSTEAD of
    mywebsite.com/images/image.jpg

    For images, it believes its STILL in the /demo directory, when I've set the .htaccess to redirect. How do I fix it so that the website believes its in the index directory?
     
    Curtis Hunter, Feb 14, 2010 IP