Possible Duplicate:
Css and javascript Not Loading in rewrite rule
After using only rewrite rule
RewriteEngine On
RewriteRule ^profile.php$ profile.php
and when i load profile.php the css and javascript are loading
but when make a change in rule and add condition
RewriteEngine On
RewriteCond %{REQUEST_URI} !/profile.php$
RewriteRule ^profile.php$ profile.php
and then the js and css are not loading
Coding of profile.php is
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-…
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link rel="stylesheet" href="http://localhost/css/profile.css" />
</head>
<body>
<table><tr><td><div class="image"><ul><li>My</li></ul></div>
</td></tr></table>
</body></html>
it’s because the
RewriteCondsays :apply the followingRewriteRuleonly if the url doesn't only contain /profilesyou should write it like :
(without the exclamation mark)
in add:
If you don’t want your mod_rewrite Rules to be apply on scripts and other specific files request, you should write a Rule for them.
E.g.