nvee Posted September 30, 2009 Share Posted September 30, 2009 Hey guys, I trust you are well I am currently sitting between a rock and a hard place, and I understand that I will not be able to get the entire project solved in this thread, but I was hoping someone can maybe shoot me in the right direction with this project. I have been assigned to design a simple marketing website for a client. It is much like all other marketing sites out there, nothing tricky. The visitor to the site will be able to list their business on the website, and it must be a complete automative project. My problem is the following. Generally, with a project like this you will have a single page (in this case client.php) and the content will be populated from the database and be displayed as www.web.com/client.php?client=123 (where client=123 is the id of the client in the database), but i have noticed a growing trend amongst websites where you can have e.g. www.web.com/clientname (this usually without an extension to the file, you can access that page and it will redirect you to the correct client page) Can anyone tell me how I will go to do this? My client wants his clients to have unique urls to assure they get more out of the package. Thank you in advance. Quote Link to comment https://forums.phpfreaks.com/topic/176057-solved-dynamic-page-names/ Share on other sites More sharing options...
Psycho Posted September 30, 2009 Share Posted September 30, 2009 mod_rewrite is what you are looking for. http://articles.sitepoint.com/article/guide-url-rewriting Note: I can't speak to the quality of that tutorial, it was just the first one when I did a google search. Quote Link to comment https://forums.phpfreaks.com/topic/176057-solved-dynamic-page-names/#findComment-927683 Share on other sites More sharing options...
nvee Posted September 30, 2009 Author Share Posted September 30, 2009 Fast and friendly, thank you sooo much! Just a quick question (and I assume the answer is yes) - From a quick browse mod rewrite works through the htaccess. file, now I have never worked with it, can the file be edited dynamically? I mean when someone e.g registers on the website, can PHP alter the file and make a entry into the htaccess file so that it is not a manual process? Quote Link to comment https://forums.phpfreaks.com/topic/176057-solved-dynamic-page-names/#findComment-927689 Share on other sites More sharing options...
cags Posted September 30, 2009 Share Posted September 30, 2009 That would be counter intuitive. The objective is to have a single rewrite rule that will pass the information to a PHP file. That PHP file will then dynamically do all the work. So once the htaccess file is created it shouldn't need editing. I wrote a fairly simplified tutorial on this sort of thing which you can view here, hopefully you'll find it usefull. Quote Link to comment https://forums.phpfreaks.com/topic/176057-solved-dynamic-page-names/#findComment-927690 Share on other sites More sharing options...
nvee Posted September 30, 2009 Author Share Posted September 30, 2009 Thank you for your reply, but your tutorial URL does not work, mind posting it again? Quote Link to comment https://forums.phpfreaks.com/topic/176057-solved-dynamic-page-names/#findComment-927975 Share on other sites More sharing options...
cags Posted September 30, 2009 Share Posted September 30, 2009 The URL does work, just the site struggles with bandwidth issues sometimes, just try it again. Quote Link to comment https://forums.phpfreaks.com/topic/176057-solved-dynamic-page-names/#findComment-928008 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.