Can apache rewrite rules go in httpd.conf
Put this in your website's <virtualhost>
.
RewriteEngine OnRewriteRule ^/vanity$ /foo/ [L]
The [L]
will silently redirect, so the user will still see /vanity in the URL. You could use [R]
to force a redirect.
For httpd.conf, wrap 'Directory' tags around your rewrite rules.For .htaccess there's no need. It's generally considered more secure to put them in your httpd.conf however, so this is what I do.