Search code examples
phpgetslash

Replace questionsmark with slash


I have a webpage where users can upload pictures, but there is a problem, I use get to know the name of the picture.

I use: mypage.com/post.php?p=1

But I want to use: mypage.com/post/1

Like in this website: http://m.nemkutya.com/like/117617


Solution

  • If I understand correctly, you wish to provide your users access to their images with a slash-notation, rather than with URL query parameters? In such case you need to look in to pretty URLs.

    One such example is mod-rewrite for Apache, and there's lots of good information around, such as: Reference: mod_rewrite, URL rewriting and “pretty links” explained