Okay so I'm rewriting a URL domain.com/id/text to domain.com/page.php?id=id using mod_rewrite / htaccess
It does what it's supposed to except the images and links all think they're in the folder domain.com/id/ - they obviously aren't. I want to avoid using a full URL for the images etc so I don't need to change my developing URLs and Live URLs among other things.Code:Options +FollowSymlinks RewriteEngine on RewriteCond %{http_host} ^webresauce.com [nc] RewriteRule ^(.*)$ http://www.webresauce.com/$1 [r=301,nc] # Rewite URL Starts here RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/([^/]+)/?$ read-post.php?id=$1&n=$2 [QSA,L]
Is there anyway using htaccess I can make it so it gets the files from the base directory not the non-existant one.
This:
http://www.webresauce.com/5712/gfhhdfg
Should look like this:
http://www.webresauce.com/read-post.php?id=5712
Any help would be much appreciated


Reply With Quote
Bookmarks