Jump to content

Directory layout similar to CraigsList


cillosis

Recommended Posts

I have been racking my brain trying a few different things and now am asking for help. I am building a niche classified ads type site and I would like to be able to have specific URL's for locations. I don't want to do subdomains (so not exactly like craigslist) but for example, for listings in Japan it would be:

 

mysite.com/japan

 

For a listing in Oregon it would be:

 

mysite.com/us/oregon

 

The main issue is that all the files are basically the same, just a copy of a shell index.php file in each folder. I have been using a lot of includes to try and make it easier on me to update without editing the file in each folder. The main difference between each folder is a simple SQL statement to decide what data to display.

 

Anyway, my question is: What is the best way to go about creating a directory structure like that while using common files? I had read somewhere that people sometimes use a subdomain for static data but I would like to avoid that. How do people normally do this?

 

Thanks in advance!

Link to comment
Share on other sites

Ok so I have been doing some more research and am looking at the concept of "Clean URLs". What do you think about these? Should you use mod_Rewrite? I suck at regular expressions. Since I am using Apache, what about ForceType? That would make it so I don't have to have all these seperate directories...I can do it all dynamically through MySQL but the user won't know that....Any ideas please?

Link to comment
Share on other sites

So let me continue the questions on this concept. With mod_Rewrite, it will rewrite your URL and display it as you want...but does it work in reverse? Can you type in that "clean" URL and it open the correct page? I want people to be able to type: "mysite.com/us/oregon" and it will open the classifieds for oregon only...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.