How to create a simple apache rewrite rule to rewrite:
http://domain.com/vanity at http://domain.com/foo/ p>
You can also rewrite the rules in httpd.conf or should they go into the .htaccess file?
Thanks in advance.
Put this on your <virtualhost> website.
<virtualhost>
RewriteEngine On RewriteRule ^/vanity$ /foo/ [L]
[L] will silently redirect, so the user will still see / vanity in the url. You can use [R] to force redirection.
[L]
[R]
For httpd.conf, wrap the "Directory" tags around the rewrite rules. There is no need for .htaccess. It is generally safer to host them in your httpd.conf, so this is what I do.
They go to httpd.conf . Check doc