subhomoy Posted March 14, 2013 Share Posted March 14, 2013 Hello every one plz help me.... I have create a wallpapers site and the way to open a specific wallpapers in another page is shown below localhost/wallpapers/view.php?id=2 [id = wallpapers id in the images tables.] In this way users can open all pages simply by changing the id... But i'm wanting to show the url in this way.... localhost/wallpapers/abc.html Is there any way to acheive this... What i've came to know is that the html page will be automatically created (correct me if I'm wrong) using php... Any help will be greately appreciated... Thank you in advance.. Quote Link to comment https://forums.phpfreaks.com/topic/275657-change-url/ Share on other sites More sharing options...
yomanny Posted March 14, 2013 Share Posted March 14, 2013 Yeah, one way would be to create an HTML file for each image, but if it is the "pretty URL" part you're concerned about I really think you should do it for real. Read up a little bit on how to do this with .htaccess, it's easier than one might think. This will let you turn wallpapers/view.php?id=2 into wallpapers/view/2 Even better, right? Here's a link to get you started: http://net.tutsplus.com/tutorials/other/using-htaccess-files-for-pretty-urls/ - W Quote Link to comment https://forums.phpfreaks.com/topic/275657-change-url/#findComment-1418611 Share on other sites More sharing options...
subhomoy Posted March 14, 2013 Author Share Posted March 14, 2013 Yeah, one way would be to create an HTML file for each image, but if it is the "pretty URL" part you're concerned about I really think you should do it for real. Read up a little bit on how to do this with .htaccess, it's easier than one might think. This will let you turn wallpapers/view.php?id=2 into wallpapers/view/2 Even better, right? Here's a link to get you started: http://net.tutsplus.com/tutorials/other/using-htaccess-files-for-pretty-urls/ - W Thanks for the info but can it be done in .html way.... If possible.... Quote Link to comment https://forums.phpfreaks.com/topic/275657-change-url/#findComment-1418612 Share on other sites More sharing options...
AyKay47 Posted March 14, 2013 Share Posted March 14, 2013 Thanks for the info but can it be done in .html way.... If possible.... What exactly do you mean? PHP code can only be interpreted in a php file. Mod_rewrite would allow you to change the PHP file to look like an HTML file in the URL, which addresses your initial question. Quote Link to comment https://forums.phpfreaks.com/topic/275657-change-url/#findComment-1418635 Share on other sites More sharing options...
subhomoy Posted March 14, 2013 Author Share Posted March 14, 2013 What exactly do you mean? PHP code can only be interpreted in a php file. Mod_rewrite would allow you to change the PHP file to look like an HTML file in the URL, which addresses your initial question. actually i want to hide the information passed in my url( ie id, name, etc)... Is there any way to hide that so the code stills works... i want to encode the details which is being transferred/ shown in the browser url.. any ideasssssss. Quote Link to comment https://forums.phpfreaks.com/topic/275657-change-url/#findComment-1418647 Share on other sites More sharing options...
AyKay47 Posted March 14, 2013 Share Posted March 14, 2013 All that should need to be passed is the id, and I do not see why that would need to be hidden or encrypted. Quote Link to comment https://forums.phpfreaks.com/topic/275657-change-url/#findComment-1418652 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.