1.开启rewrite模块,使用命令:a2enmod rewrite
2.在apache2.conf,配置你网站的目录(是目录而定)
3.在你的网站目录下添加去掉index.php的.htaccess(分布式配置文件)
<IfModule mod_rewrite.c> RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]</IfModule>
4.重启apache. service apache2 restart .即可实现
版权声明
本文仅代表作者观点,不代表百度立场。
本文系作者授权百度百家发表,未经许可,不得转载。



