Log in

View Full Version : Resolved pretty URL



ggalan
01-20-2011, 08:31 PM
does anyone know how they got rid of the ".php" in this url

http://www.createthegroup.com/en/whoweare/managementteam/?bio=JamesGardner

djr33
01-20-2011, 09:55 PM
It's the index file, so you just access it by typing the name of the directory:

site.com/directory/
site.com/directory/index.php

Those go to the same place.

And for both you can add a query string using the ? symbol.

ggalan
01-20-2011, 10:30 PM
but how can you hide the "index.php" when you add the query?
if you placed it


index.php?var=foo

then the "index.php" would be visible

Schmoopy
01-20-2011, 11:35 PM
Well, one way is:



www.website.com/?var=hello


That hides that it's the index, the other method is doing it with htaccess.

ggalan
01-21-2011, 12:08 AM
so something like this?
and inside a folder called 'somefolder' you would have a "index.php"


<a href='somefolder/?var=hello '></a>

traq
01-21-2011, 12:41 AM
yup..

djr33
01-21-2011, 12:46 AM
In other words, "index.php" and similar default filenames* can always be omitted from URLs and everything that goes before AND everything that goes after remains as it was. Mathematically: X+index.php+Y = X+Y.


(*php, html, asp and other "html" filetypes, named index.ext, home.ext, default.ext, and perhaps more, depending on your server configuration. I've never known of a server where index isn't the default like that.)