cobaswosa Posted September 10, 2009 Share Posted September 10, 2009 Hello all. Let's say I have the url domain.com How would I go about having it so that when a user goes to domain.com/folder/subfolder where folder/subfolder does not exist it instead outputs the page domain.com/page.php?path=folder/subfolder but while still having folder/subfolder in the address bar? Im sure there are many ways to do it, but I am just looking for the best way. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/173825-dynamic-urls/ Share on other sites More sharing options...
Rommeo Posted September 10, 2009 Share Posted September 10, 2009 htaccess file can deal with it. You just need write few lines of code there, then you can do whatever you want. Check this out : http://web-programming.suite101.com/article.cfm/url_rewriting_via_htaccess Quote Link to comment https://forums.phpfreaks.com/topic/173825-dynamic-urls/#findComment-916261 Share on other sites More sharing options...
Adam Posted September 10, 2009 Share Posted September 10, 2009 Looking for mod_rewrite. Quote Link to comment https://forums.phpfreaks.com/topic/173825-dynamic-urls/#findComment-916263 Share on other sites More sharing options...
cobaswosa Posted September 10, 2009 Author Share Posted September 10, 2009 Okay cool thought htaccess might work (or the server config file) just wanted to make sure that wasn't a dumb way to do it. Thanks a lot man! Edit: Thanks for the link Mr adam. One more thing though, will search engines index the static urls (even though they don't actually exist physically)? Quote Link to comment https://forums.phpfreaks.com/topic/173825-dynamic-urls/#findComment-916264 Share on other sites More sharing options...
Rommeo Posted September 10, 2009 Share Posted September 10, 2009 As I know -No it just indexes if you use static urls somewhere. if you dont use it I dont think that it will index. Quote Link to comment https://forums.phpfreaks.com/topic/173825-dynamic-urls/#findComment-916268 Share on other sites More sharing options...
cbolson Posted September 10, 2009 Share Posted September 10, 2009 One more thing though, will search engines index the static urls (even though they don't actually exist physically)? There is a good chance that they will, unless you specifically tell them not to. If the robots can find the url and find that it has content as long as you haven't told them otherwise (via headers, robots.txt, htaccess etc) they will index the page. Quote Link to comment https://forums.phpfreaks.com/topic/173825-dynamic-urls/#findComment-916380 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.