Greg
Greg

Reputation: 479

Clean URL with Rewrite

i want to make

mysite.com/photo.php?id=l0el2rwbFj7kGG3

become

mysite.com/photo/l0el2rwbFj7kGG3

The rewrite i am using is

RewriteEngine On
RewriteRule ^photo/([a-zA-Z0-9]+) photo.php?id=$1 [L,NC]

Can anyone help me out please?

Upvotes: 1

Views: 82

Answers (2)

senk
senk

Reputation: 44

try this more easy one:

RewriteEngine on
RewriteRule ^photo/(.*)$ photo.php?id=$1

Upvotes: 0

anubhava
anubhava

Reputation: 784898

You've got it right (almost). Just change your code by this:

RewriteRule ^photo/(.+)$ photo.php?id=$1 [L,NC,QSA]

Upvotes: 1

Related Questions