runeveryday Posted December 8, 2009 Share Posted December 8, 2009 there is a url http://example.com/index.php/term/bo.xhtml. now i want to make it turn into http://example.com/bo.xhtml. how should i do,the key to solve this question is url redirection or url rewrite? any tips would be appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/184335-change-the-url/ Share on other sites More sharing options...
cags Posted December 8, 2009 Share Posted December 8, 2009 They are in essence the same thing. The server is taking the URL entered by the user, parsing it and deciding which page to actually show them. The only conceptual difference would be whether you wish the user to know they have been redirected. Take you two example URLs. Do you wish... 1.) the user to enter URL 1 and to then be re-directed (ie the address bar in their browser changes) to URL 2? 2.) the user to enter URL 2 and to then be re-directed (ie the address bar in their browser changes) to URL 1? 3.) the user to enter URL 1 but to see the contents of URL 2 without the URL in the address bar changing? 4.) the user to enter URL 2 but to see the contents of URL 1 without the URL in the address bar changing? The most common use of mod_rewrite is probably option 4 as it allows for so called 'Pretty URLs', ie the user types in example.com/members/bob but the page they are really seeing is example.com/member.php?name=username. Quote Link to comment https://forums.phpfreaks.com/topic/184335-change-the-url/#findComment-973183 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.