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
  • 34,719
  • 24
  • 185
  • 251
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) – 2v0mjdrl 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
  • 39,545
  • 18
  • 87
  • 107