Saturday, 31 August 2013

mod_rewrite - URL with subdirectory

mod_rewrite - URL with subdirectory

I'm trying to change this URL: example.com/stickit/note.php?note=1
to this: example.com/stickit/note/1
I have tried to do it this way, but all I get is a 404 error:
RewriteEngine On
RewriteRule ^stickit/note/(.*)$ /stickit/note.php?note=$1 [L]
Funnily enough, this works:
RewriteEngine On
RewriteRule ^note/(.*)$ /stickit/note.php?note=$1 [L]
It changes example.com/stickit/note.php?note=1
to : example.com/note/1

No comments:

Post a Comment