Dynamic Directory Redirect? Direct a dynamically named folder to an info page?
Ok, so I have a list of places (for this example we'll pretend they're cities) and I need to make this happen:
If someone types/clicks "mysite.com/seattle" it should display "mysite.com/places.php?place=seattle" while still having "mysite.com/seattle" in the address bar...
If someone types/clicks "mysite.com/boston" it should display "mysite.com/places.php?place=boston" while still having "mysite.com/boston" in the address bar...
Problem is, the "place names" are dynamic. We can add "sacramento" or "dallas" etc at any random time, but I need the site to dynamically show them the information page (places.php) with some kind of variable passed (through GET or POST or whatever) if that directory doesn't actually exist. (/gallery would still be the gallery images, etc)
I will also have all that information available in a database, so for example, to add "dallas" we would add an entry with the name "Dallas" to our MySQL database with a unique ID and all of the information we need all in the database...
Any help is greatly appreciated.
This is a simple job for mod_rewrite if you are using Apache for your webserver. For more info: http://httpd.apache.org/docs/current...d_rewrite.html
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)