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

Link to comment
Share on other sites

 

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.