Reputation: 8990
i have this rewrite rule for my urls, it deosnt seem to acess the css and images, why? :))
orginal url its working:
http://www.example.co.uk/viewprofile.php?user=muna
rewrited url, this deosnt work:
http://www.example.co.uk/user/muna
htaccess code:
RewriteEngine On
RewriteRule ^user/([^/]*)$ /viewprofile.php?user=$1 [L]
my css files are stored in /css folder and images in the /images folder
Upvotes: 1
Views: 1040
Reputation: 91
or you can add some rules, and then you may don't need change the html code.
RewriteRule ^user/css/(.*)$ /css/$1 [L]
Upvotes: 0
Reputation: 8990
sorry guys, i found the solution, im gonna answer this question just for future reference for other stackoverflowers, basically when you do a rewrite on any url just make sure when your linking to javascripts, css or images the right way for example:
if before you had:
<link rel="stylesheet" type="text/css" href="css/demo.css"></link>
then change to this:
<link rel="stylesheet" type="text/css" href="/css/demo.css"></link>
quote the extra /
before css folder name. thanks hope it helps
Upvotes: 2