tags:

views:

61

answers:

8

I am updating a PHP-based site and the URL looks like this:

http://www.thesite.com/index.php/what/are/these

Can somebody give me an idea as to what is going on after the index.php? It looks like directories to me, but there are none that I can see with the same names. Is this some sort of URL rewriting?

Thanks!

PS the CMS is Jetbox v2.1

+1  A: 

Yes, that looks like URL rewriting to me. Without more info I can't be more specific.

Ian Wetherbee
+3  A: 

Someone, somewhere, is using $_SERVER['PATH_INFO']. It is a server variable set by e.g. Apache 2 and gives the remainder of the URL after the object (document/script/w/ever) found in URL being served.

+1  A: 

You're usually going to see URLs like these when the host in which the server is running does not support .htaccess but the programmer still wanted to have "pretty urls" - I know for a fact that CakePHP has their URLs look this way in this situation, as does CodeIgniter. It could also simply be manually done, but I'd bet on the author using a framework of some sort.

Paolo Bergantino
Symfony does this as well.
Maerlyn
A: 

MVC routes? It's just a guess, I'm not familiar with any MVC implementation in PHP (haven't used PHP since 4.0).

David
+1  A: 

Probably. You'll want to do the following:

  • Look at the .htaccess file for any RewriteRule directives
  • Look in index.php to see if it's using any $_SERVER variables (like $_SERVER['QUERY_STRING'])
  • Look at the logs to see what files are actually being sent to the client
infamouse
+1  A: 

This extra information is passed to the script to do with as it pleases.

In PHP, you can find its value in $_SERVER['PATH_INFO']

Rowland Shaw
A: 

Yes this is due to a MVC framework being used, such as CodeIgniter

Eton B.
A: 

Those are generally used a like GET variables, it's just a way of passing information along with your request. There are a few different ways to implement this but the aim is usually to have cleaner looking urls. I'm confused why they left the index.php in there - it could be a poorly done homebrew attempt. (Not that I have anything against homebrew solutions for common problems - best way to learn IMO)

If you want to figure out more, look for instances in the code where information is needed about which article to pull, etc... See where that information is coming from and work backwards. If you can't figure out how it works from the code then go through .htaccess and look for url rewriting logic.

Syntax Error