【Codeigniter】-Mod_Rewrite-菜鸟日记(2)

Rewrite 要打开Apache
接着我们写入以下资料,记住要新增在<VirtualHost *:80>底下:

<Directory /var/www/html>  Options Indexes FollowSymLinks MultiViews  AllowOverride All  Order allow,deny  allow from all</Directory>
sudo a2dissite 000-default.conf //取消作用sudo a2ensite laravel.conf //激活sudo a2enmod rewrite //开启Apache的mod_rewrite功能sudo service apache2 restart //重启Apache
.htaccess
RewriteEngine onRewriteCond $1 !^(index\.php|assets|fonts|images|img|js|css|uploads|favicon.png)RewriteCond %(REQUEST_FILENAME) !-fRewriteCond %(REQUEST_FILENAME) !-dRewriteRule ^(.*)$ ./index.php/$1 [L]

关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章