Forum Moderators: phranque
I've been coding in php, javascript etc (the usual suspects) for quite some time, but have never taken the time to really learn regular expressions. Bad idea it seems :)
I'm new to websites and all the SEO, pretty urls etc that comes with it (I was a systems coder initially), and I've got myself a bit stuck.
I basically have a catch all rewrite rule to send everything to index.php, and I handle everything there. Its worked out just fine for me, Im happy having everything in one place.
RewriteEngine On
RewriteRule .*index.php[L]
<script src="js/myfile.js"></script>
Hope that makes sense, Im notorious for over complicating things and confusing everyone around me.
Thanks in advance!
RewriteEngine on
#
RewriteCond %{REQUEST_URI} !^/index\.php$
RewriteCond %{REQUEST_URI} !\.js$
RewriteCond %{REQUEST_URI} !\.css$
RewriteRule .* /index.php [L]
RewriteEngine on
#
RewriteCond $1 !^index\.php$
RewriteCond $1 !\.(css¦js)$
RewriteRule (.*) /index.php [L]
Beware of rewriting URLs such as robots.txt and avoid using your script to handle the error pages for critical server errors. In both cases, the fewer dependencies associated with these resources, the better.
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim
[edited by: jdMorgan at 10:56 pm (utc) on Nov. 3, 2007]