SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Nov 2009
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Database and permalink structure for a directory site

    Hi,

    I started building a business directory from scratch with PHP & MySQL but before I go further with the design, I want to finalize the database and permalink structure so that I will not need to make dramatic changes later.

    The directory will have the following:

    - pages (e.g., About, Contact)
    - posts (blog posts for directory news & updates)
    - listings ( business listings with all details like name, address, phone, city, state, country, website etc.)
    - locations (city, state, country)

    I am considering using a page.php, post.php, listing.php and location.php file for different styles and content.

    On one side, I want an optimum database structure and on the other side, I want a user friendly permalink structure. For example:

    I can have pages and posts in one table,
    I can have business listings in one table,
    I can have a table for locations as well (city, state, country).

    Question 1: How would you design the database for such a directory?

    The real problem is about the permalinks. Because I need to design the database considering the permalinks. For example, I want the following type of permalinks:

    for pages:
    example.com/about
    example.com/contact

    for listings:
    example.com/business-one
    example.com/business-two

    for locations:

    example.com/country1
    example.com/country1/state1
    example.com/country1/state1/city1

    Question 2: I know basic redirection with .htaccess and I can do that if it was one type of content such as pages, but it becomes complicated when there are different type of database entries. How would you handle the permalinks?

    I have been trying to find tutorials for creating such a business directory but couldn't find anything. Any ideas, comments, suggestions or tutorial links would be appreciated.

    Thanks.

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,509
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Would you mind explaining why you need to design the database considering the permalinks? And why redirection becomes complicated when there are different type of database entries? What is the link between database design and permalinks?

  3. #3
    SitePoint Addict
    Join Date
    Nov 2009
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by guido2004 View Post
    Would you mind explaining why you need to design the database considering the permalinks? And why redirection becomes complicated when there are different type of database entries? What is the link between database design and permalinks?
    Perhaps I don't need to design the database considering the permalinks, but I don't know how to accomplish what I explained in detail above and this is why I asked that question.

  4. #4
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,509
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    I'm going to move this question to the PHP forum. I'm sure you'll get more help there.


Bookmarks

Posting Permissions

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