1

I have a URL that looks like:

url.com/show.php?id=abc
url.com/show.php?id=xxx

How would I go about converting that URL to

url.com/abc
url.com/xxx

How do I go about making friendly URLs in PHP?

homlox
  • 21
  • 4
  • See also: [Reference: mod\_rewrite, URL rewriting and "pretty links" explained](http://stackoverflow.com/q/20563772) – mario Jul 24 '15 at 02:47

1 Answers1

2

I guess you want something like the following in your .htaccess file

#Turn on the rewriting engine
RewriteEngine On
RewriteRule ^([A-Za-z0-9-]+)/?$ show.php?id=$1 [NC,L] 
Amit Verma
  • 40,709
  • 21
  • 93
  • 115