I'm trying to learn Regex & URL Rewriting in PHP. How can I create an .htaccess file which will rewrite (not redirect) any url to index.php?q={url}
?
For example:
to
I tried:
RewriteEngine On
RewriteRule ^$ index.php?q=$1 [R]
...but it is not working. What am I doing wrong?
Thanks.