Jump to content

Recommended Posts

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..

Link to comment
https://forums.phpfreaks.com/topic/275657-change-url/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/275657-change-url/#findComment-1418611
Share on other sites

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....

Link to comment
https://forums.phpfreaks.com/topic/275657-change-url/#findComment-1418612
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/275657-change-url/#findComment-1418635
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/275657-change-url/#findComment-1418647
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.