cillosis Posted March 24, 2009 Share Posted March 24, 2009 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! Quote Link to comment https://forums.phpfreaks.com/topic/150955-directory-layout-similar-to-craigslist/ Share on other sites More sharing options...
cillosis Posted March 24, 2009 Author Share Posted March 24, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/150955-directory-layout-similar-to-craigslist/#findComment-793141 Share on other sites More sharing options...
cillosis Posted March 24, 2009 Author Share Posted March 24, 2009 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... Quote Link to comment https://forums.phpfreaks.com/topic/150955-directory-layout-similar-to-craigslist/#findComment-793178 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.