0

I've a php page with following string.

http://mydomain.com/businesspage.php?profile=Khafihan

So I'm trying to convert this url to following style

http://mydomain.com/Khafihan

Is it possible with php and how ?

Thanks for your help.
Regards.

Yotam Omer
  • 14,836
  • 11
  • 58
  • 62
Alex
  • 13
  • 5

2 Answers2

2

I think this .htaccess rule should do what you want:

RewriteEngine On
RewriteRule ^([a-z0-9]+)$ /businesspage.php?profile=$1 [L]
sisve
  • 19,243
  • 3
  • 54
  • 93
Amal Murali
  • 73,160
  • 18
  • 123
  • 143
2

You need to put the following lines into your .htaccess file:

RewriteEngine On 
RewriteRule /(.*)$ /businesspage.php?profile=$1
Maciej A. Czyzewski
  • 1,541
  • 1
  • 13
  • 24