apache 配置rewrite模塊,URL中隱藏index.php

打開httpd.confphp

去掉下面的井號服務器

#LoadModule rewrite_module modules/mod_rewrite.so把前面的警號去掉 

在網站根目錄添加.htaccess網站

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ index.php/$1 [L] 

重啓服務器blog

相關文章
相關標籤/搜索