How do you get URLs like below when using php?

http://domain.com/photos/022010/01/

Where it normally is written like this:

http://domain.com/photos.php?date=022010&id=01

I see sites like this all the time now and am curious how this is accomplished. I do have an idea though...

When creating a directory for example photos. Do I just put an index.php file in that directory and just in my php instead of calling on a href as "?date=.$row." do I call it as "/.$row./" ?

Hope that is explained well. I guess twitter would be an example of what I am talking about. I just cannot recall the url where I specifically saw this.

If someone does know what I am talking about can they please shed some more light on it?
Thanks!
Brian

Recommended Answers

All 3 Replies

you need to use Mod_Rewrite for that. Here is a Mod_Rewrite manual designed for newbies.

sweeeet im definitely going to use this!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.