How to convert asp to php?

Mypage.com/home.php?u=John ||| change/convert to this: Mypage.com/home.php/John?

  • Mypage.com/home.php?u=John ||| change/convert to this: Mypage.com/home.php/John? I have the first example on my website, but I was wondering, how to make the url like Facebook or Youtube? I currently have this Mypage.com/home.php?u=John and now I want to change it to this Mypage.com/home.php/John and boom, you are in John's profile! Im using php to get the u=John, you know $_GET["u"]... but how I can do the other way? PD: I have experience in php, a little bit on JS and obviously html. I accept tutorials, links, explications and everything else =)

  • Answer:

    this is NOT done with PHP. they are using something on the apache server special to tweak the URL and modify it or handle it differently. I think it's mod rewrite. something like that you would have to make your own .htaccess file to do this if your server permits. I would start digging into the apache httpd manual. hope you are up on regular expressions. if not, there's a book out from o'reilly, Mastering Regular Expressions, it's *Extremely Useful* if you need to validate input on HTML5 using the pattern attribute.

Bonachon at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.