apache rewrite rules for controller directory
I have controller directory开发者_JAVA技巧 where is controller files located.
I want to do this
sitename.com/test.php
not
sitename.com/controller/test.php
how to rewrite rules with apache?
You'll want to look into mod_rewrite in your .htaccess
Adding a rewrite rule in your .htaccess is simple. First, activate mod_rewrite by adding this line to your .htaccess:
RewriteEngine on
RewriteBase /
Then add your rule to redirect your pages:
RewriteRule ^([^/]+)$ /controller/$1
精彩评论