Alright, I got an Apache localhost server up and running with PHP and MySql. Now I want to be able to use a .htaccess
file as well to use RewriteRule
You place .htaccess
file in the web directory you want the code to control (and any sub directories). For a Rewrite, it typically goes in the root dir and acts upon the index.php page.
For example, if you put the .htaccess
file in \dev\www\ directory, and your .htaccess
file has something like RewriteRule ^(.*)$ /index.php?/$1 [L]
this is a regex that is saying get all the characters in the URL and append them to the /index.php?
script. The /$1
is a back reference in regex.