Jun
Jun

Reputation: 1

htaccess RewriteRule along with parameter

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.

Upvotes: 0

Views: 14

Answers (1)

Amit Verma
Amit Verma

Reputation: 41219

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" .

Upvotes: 1

Related Questions