Forum Moderators: phranque

Message Too Old, No Replies

mod_rewrite to redirect all traffic...except js files?

         

McJack

11:17 pm on Apr 21, 2004 (gmt 0)

10+ Year Member



I am currently using mod_rewrite to redirect all traffic, regardless of what is typed in the address bar.

RewriteRule (.*) index.php [PT]

The problem is however, that if my page includes a .js or .css file from a sub-folder, it won't grab that file (presumably due to the "catch-all") Does anyone have any ideas how to fix it so the .js and .css files will work?

Birdman

11:36 pm on Apr 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sure! Use the RewriteCond directive [httpd.apache.org].

welcome to the forums!

McJack

12:07 am on Apr 22, 2004 (gmt 0)

10+ Year Member



In what way though? When I try to add what I think are effective conditional statements, it merely breaks the "catch-all" for the address bar pages.

McJack

12:12 am on Apr 22, 2004 (gmt 0)

10+ Year Member



Never mind... I got it!

RewriteCond %{REQUEST_URI}!^/javascript.*
RewriteRule (.*) index.php [PT]