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
  • 37,241
  • 25
  • 195
  • 267
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
  • 40,709
  • 21
  • 93
  • 115