Apache 配置,共有两个目的
能够对程序进行解析
能够实现静态化
我们希望访问的地址为 www.{yourdomain}.com/Hello/World
<IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteCond %{QUERY_STRING} ^(.*)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(\w{1,})/(\w{1,})/?$ index.php?_controller=$1&_function=$2&%1 [L] RewriteCond %{QUERY_STRING} ^(.*)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(\w{1,})/(\w{1,})/(\w{1,})/?$ index.php?_controller=$1&_function=$2&__function=$3&%1 [L] order deny,allow </IfModule>