0

I have got different pages in my website(portal) which may take one or more parameters from the URL.

So the URL www.example.com/xyz has to be solved into or like www.example.com/profile.php?id=xyz and the value id should be able to get using GET method.

I'm working on PHP. Any answers would be highly appreciated. (I'm new to PHP and have only basic+ knowledge in it. Please explain briefly.)

Joe
  • 4,503
  • 4
  • 28
  • 47
Ashwin P M
  • 1
  • 1
  • 1
  • [This is a great resource.](http://stackoverflow.com/questions/20563772/reference-mod-rewrite-url-rewriting-and-pretty-links-explained) There's a lot there to read through, but while someone could give you something brief that does what you're trying to do, what you're asking about really can't be _explained_ briefly. – Don't Panic Jan 25 '17 at 17:40

1 Answers1

0

To go from: www.example.com/profile.php?id=xyz into www.example.com/xyz you can use the following rule in your .htaccess file:

RewriteEngine On
RewriteRule ^([^/]*)$ /profile.php?id=$1 [L]

Just make sure you clear your cache before testing this.

Joe
  • 4,503
  • 4
  • 28
  • 47