Hy!
I’m developing a web site and have a small problem with .htaccess.
Problem:
how to rewrite urls?
From: http://www.mysite.com/index.php?page=about
To: http://www.mysite.com/about/
and
From: http://www.mysite.com/index.php?page=stuff&catId=1
To: http://www.mysite.com/stuff/1/
and
From: http://www.mysite.com/index.php?page=stuff&catId=1#someAnchor
To: http://www.mysite.com/stuff/1/#someAnchor
Currently I’m doing this but it doesn’t work! 🙁
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^page/([^/\.]+)/?$ index.php?page=$1 [L]
RewriteRule ^page/([^/.]+)/([^/.]+)/?$ index.php?page=$1&catId=$2 [L]
</IfModule>
Please help.
Thanks in advance, Silvano.
This will do what you want:
Works on my local server (WAMP).