进入/etc/apache2/mods-enabled
打开终端输入
cd /etc/apache2/mods-enabledsudo a2enmod rewrite
重启apache2
sudo /etc/init.d/apache2 restart
这样就开启了rewrite
下面解决thinkphp框架中消除url中index.php的问题
进入index.php所在目录
创建文件.htaccess
并输入内容
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>现在登录web就不再需要url中的index.php了

884

被折叠的 条评论
为什么被折叠?



