PHP: Skipping index page call in URL Sep23 '05

A page request sometimes relies on a variable in the URL string.

For example, an Administration page I am maintaining has an address of:

http://www.mypage.com/admin/

Within the admin folder, there is an index.php file, which handles all requests.

To allow for a dynamic template, I have a variable within index.php called page, which is used to pull the proper content.

So, a typical request could look like this:

http://www.mypage.com/admin/index.php?page=products

Except, it’s also OK to skip the index.php? part entirely, and go directly to the page variable:

http://www.mypage.com/admin?page=products

So, in this case, the index.php part is inferred. This is a nice way to shorten up your URI requests.

Categories: Efficiency , PHP , Tutorials , Web Development

Add Feedback (view all)

Leave feedback

Feedback

Input format: The editor controls below will assist with Markdown syntax.

Status

Sub-status

Your info

matthom is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from a suburb of Chicago. Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.

Contact Matt

Popular Pages

  1. Fast rounded corners in Photoshop (7873 recent visits)
  2. PHP – passing variables across pages (2857 recent visits)
  3. JavaScript set selected on load (2345 recent visits)
  4. Removing all child nodes from an element (1704 recent visits)
  5. iPod songs out of order? (1412 recent visits)
  6. Firefox 3 smart address bar: wildcard search (1300 recent visits)
  7. Britney - Everytime piano tab (1180 recent visits)
  8. MySQL LEFT JOIN syntax (971 recent visits)
  9. Breathe Me - Sia (824 recent visits)
  10. Tumblr: how blogging should be (727 recent visits)

Similar Entries

Stats

47 unique visits since August 2008

Syndicate

Advertisements