www.webdeveloper.com
Results 1 to 2 of 2

Thread: Dynamic Directory Redirect? Direct a dynamically named folder to an info page?

Hybrid View

  1. #1
    Join Date
    Apr 2011
    Location
    Seattle, WA
    Posts
    264

    Exclamation 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...
    etc...

    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 ideas?

    Any help is greatly appreciated.

    Thanks!

  2. #2
    Join Date
    Oct 2010
    Location
    Ohio
    Posts
    233
    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
    ~Ryan
    www.rdennispallas.com <-- Personal Site, changing regularly cuz its ugly.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles