0

i have a rewrite pattern

RewriteRule    ^category/([0-9]+)/([0-9]+)/(.*)/?$    index.php?do=showCat&catId=$1&p=$2    [NC,L]    

all my links to imgs and the css or .js files are relative to the server, with this rewrite pattern , all the addresses are corupted now, is there any way to stop rewrite module on this situation.

i dont want to use HTML < base > Tag, it does't supported on IE -8

Hell Lord
  • 37
  • 8
  • nothing mod rewrite can help you with. its a browser problem. (which you could fix for all browser expect ie8 with the base tag) you will have to rewrite all links/src to absolut links. – Rufinus Mar 15 '12 at 12:24
  • base tag fix for ie8/9 is to use full url with http:// see http://stackoverflow.com/questions/3926197/html-base-tag-and-local-folder-path-with-internet-explorer – Rufinus Mar 15 '12 at 12:27
  • OMG! its a huge work!! i saw some solutions on forums but just confused me... i don't know much about this module, but i know there is a way to specify files Extensions and stop the rewrite on those .... – Hell Lord Mar 15 '12 at 12:28
  • you dont understand, yes you can say dont rewrite if target is a file. but the problem is the browser, which tries to add the relative path to the request_uri which then leads to a 404. – Rufinus Mar 15 '12 at 12:36
  • this is what you meant (first rule in order): RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] but it will not fix your problem. – Rufinus Mar 15 '12 at 12:37
  • Just use root-relative urls. So instead of `href="../folder/file.css"`, use `href="/folder/file.css"` – Gerben Mar 15 '12 at 18:43
  • tanx everyone, i don't know why i made such a mistake. its impossible. – Hell Lord Mar 15 '12 at 19:42

0 Answers0