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
  • 15,310
  • 11
  • 62
  • 65
Alex
  • 11
  • 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,501
  • 3
  • 53
  • 95
Amal Murali
  • 75,622
  • 18
  • 128
  • 150
2

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

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