gordon.c Posted June 24, 2009 Share Posted June 24, 2009 Hi, I am wonder how to generate website content using php to make the address look like this www.mypage.com/my_article instead of www.mypage.com/my_article/index.php Do you know what I mean? To make the address simple as the example above Quote Link to comment https://forums.phpfreaks.com/topic/163510-solved-dynamically-generated-sites/ Share on other sites More sharing options...
947740 Posted June 24, 2009 Share Posted June 24, 2009 Well, as long as you have a default file in that folder, you can just point to that folder. I.E. <a href='http://www.mypage.com/my_article'>clicky</a> As long as you have a default file set in your server settings. There are also ways to do URL masking and things like that, but someone else will be able to explain that much better than I can. Quote Link to comment https://forums.phpfreaks.com/topic/163510-solved-dynamically-generated-sites/#findComment-862699 Share on other sites More sharing options...
JonnoTheDev Posted June 24, 2009 Share Posted June 24, 2009 They will both serve the same page. Please elaborate. index.php should be the default if no filename is specified. I have a feeling you are talking about mod-rewritten urls. If so this is not php. Check out the mod rewrite forum Quote Link to comment https://forums.phpfreaks.com/topic/163510-solved-dynamically-generated-sites/#findComment-862700 Share on other sites More sharing options...
gordon.c Posted June 24, 2009 Author Share Posted June 24, 2009 Oh all right... I will check it out than. I want to have it like wikipedia has. very simple adresses to make it look good Quote Link to comment https://forums.phpfreaks.com/topic/163510-solved-dynamically-generated-sites/#findComment-862737 Share on other sites More sharing options...
947740 Posted June 24, 2009 Share Posted June 24, 2009 Just have every single script redirect to the main folder. You don't need your processing scripts to echo anything, so just have them redirect to the main folder as well. Quote Link to comment https://forums.phpfreaks.com/topic/163510-solved-dynamically-generated-sites/#findComment-862742 Share on other sites More sharing options...
gordon.c Posted June 24, 2009 Author Share Posted June 24, 2009 ok... so that means every time I save up an article (on my blog) I save it using php as html file into a new folder named after my title right? So after a while I may have hundreds of folders, does it work that way? Quote Link to comment https://forums.phpfreaks.com/topic/163510-solved-dynamically-generated-sites/#findComment-862754 Share on other sites More sharing options...
947740 Posted June 24, 2009 Share Posted June 24, 2009 That WAS what I was saying. The feasibility is questionable, but you can just create a folder in which all of those reside, and then use PHP to create each individual folder. Quote Link to comment https://forums.phpfreaks.com/topic/163510-solved-dynamically-generated-sites/#findComment-862762 Share on other sites More sharing options...
scarhand Posted June 24, 2009 Share Posted June 24, 2009 You do this using Apache's mod_rewrite Quote Link to comment https://forums.phpfreaks.com/topic/163510-solved-dynamically-generated-sites/#findComment-862803 Share on other sites More sharing options...
947740 Posted June 24, 2009 Share Posted June 24, 2009 I believe we established that... I have a feeling you are talking about mod-rewritten urls. If so this is not php. Check out the mod rewrite forum Quote Link to comment https://forums.phpfreaks.com/topic/163510-solved-dynamically-generated-sites/#findComment-862854 Share on other sites More sharing options...
aggrav8d Posted June 24, 2009 Share Posted June 24, 2009 gordon - mod_rewrite will turn a request for [your site]/some_page into [your site]/index.php?show_me_page=some%20page Then index.php can query a database for a page named "some page" and display it's contents. Quote Link to comment https://forums.phpfreaks.com/topic/163510-solved-dynamically-generated-sites/#findComment-862857 Share on other sites More sharing options...
gordon.c Posted June 25, 2009 Author Share Posted June 25, 2009 Ok... thanks everyone for help Quote Link to comment https://forums.phpfreaks.com/topic/163510-solved-dynamically-generated-sites/#findComment-863307 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.