Jump to content

[SOLVED] my.temp.ip/game/status/set to my.temp.ip/game/index.php/status/set ??


ultrus

Recommended Posts

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. :)

 

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/".

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.