ultrus Posted January 31, 2009 Share Posted January 31, 2009 http://my.temp.ip/game/status/set to http://my.temp.ip/game/index.php/status/set ?? Not sure if that makes sense. I'm trying to drive everything in /game to /game/index.php file for a mini-framework that will look at the url more closely. Any thoughts on how to rewrite this? Here's what I have that does NOT work: RewriteRule ^game/$ /game/index.php/$1 [L] I also want to exclude /game/styles folder from this. With that in mind, the complete non-functional rules look like this: Options +FollowSymLinks RewriteEngine On RewriteCond !^(game/styles) RewriteRule ^game/$ /game/index.php/$1 [L] Any thoughts on what I'm messing up? Thanks much for the assist. Quote Link to comment Share on other sites More sharing options...
corbin Posted February 1, 2009 Share Posted February 1, 2009 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^game/(.*) /game/index.php/$1 (The two rewrite conditions make sure the URL being rewritten isn't a file or directory before being rewritten. That would make sure styles was excluded, and it would exclude /game/index.php. You could of course just do the exceptions by hand though, and you might not want people to be able to type in as the URL /game/index.php/blah.) As to why yours wasn't working: ^game/$ ^ means starting with game means literally g then an a then a m then an e ;p / literally means / $ means ends with So, it would mean that the URL starts with g, contains 1 a then 1 m then 1 e then 1 / then it ends. In other words, that would match "game/" and only "game/". Quote Link to comment Share on other sites More sharing options...
ultrus Posted February 1, 2009 Author Share Posted February 1, 2009 It works like... voodoo magic! Thank you much for the help. It's working great. I'll continue to read up on the subject. Quote Link to comment Share on other sites More sharing options...
corbin Posted February 1, 2009 Share Posted February 1, 2009 No problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.