0

How should I write in htaccess file to rewrite

http://mySite/index.php?id=55 as http://mySite/55 ??

55 is just an example, but it will vary on each id.

Cœur
  • 32,421
  • 21
  • 173
  • 232
Jun
  • 1
  • 1
  • 1
    Possible duplicate of [Reference: mod\_rewrite, URL rewriting and "pretty links" explained](http://stackoverflow.com/questions/20563772/reference-mod-rewrite-url-rewriting-and-pretty-links-explained) – ThePadawan Apr 28 '16 at 05:22

1 Answers1

1

In htaccess in the document root

RewriteEngine on


RewriteRule ^([^./]+)$ /index.php?id=$1 [L]

This will allow you to access "/index.php?id=numbr" using "/number" .

Amit Verma
  • 38,175
  • 19
  • 80
  • 104