【laravel】laravel5环境隐藏index.php后缀(apache)
来源:互联网 发布:支付宝微信收银软件 编辑:程序博客网 时间:2024/05/31 06:21
在这之前我将laravel目录下的server.php重命名为index.php
链接变成了http://localhost/blog/index.php/xxx/xxx
之前我根据网上的方法操作过,很多都不能用,然后看到一篇搭建laravel环境的文章,有了思路
1、sudo vim /etc/hosts
添加: 127.0.0.1 xuan.blog(后面我发现这里其实可以随便填。。。)
2、启用mod_rewrite
sudo a2enmod rewrite
然后重启apache服务器
sudo service apache2 restart
3、修改apache2.conf
sudo vim /etc/apache2/apache2.conf
在最后添加:
ServerName localhost
DirectoryIndex index.html index.htm index.php
DirectoryIndex index.html index.htm index.php
并且修改:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride all(这里改为all)
Require all granted
</Directory>
Options Indexes FollowSymLinks
AllowOverride all(这里改为all)
Require all granted
</Directory>
4、添加blog.conf (配置虚拟站点,这里哪个名字也是可以改的)
sudo vim /etc/apache2/sites-available/blog.conf
添加:
<VirtualHost *:80>ServerName xuan.blogDocumentRoot /var/www/html/blog/publicErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined</virtualHost>
5、启用虚拟站点
sudo a2ensite blog.conf
sudo service apache2 reload
6、最后再设置下权限
sudo chmod -R 0777 /var/www/html/blog
0 0
- 【laravel】laravel5环境隐藏index.php后缀(apache)
- apache rewrite重写隐藏index.php
- ubuntu apache下设置隐藏index.php
- thinkphp 隐藏index.php iis apache nginx
- 在apache中隐藏php文件后缀
- Laravel解决nesting level错误和隐藏index.php
- Apache RewriteCond RewriteRule 入门和Laravel去掉index.php
- laravel5.0在linux环境下解决.htaccess无效和去除index.php
- laravel5.0在linux环境下解决.htaccess无效和去除index.php
- apache服务器开启rewrite模式(隐藏index.php)
- apache 配置虚拟目录+默认页+隐藏index.php
- thinkPHP Apache 优化url,隐藏index.php所需配置
- apache配置伪静态隐藏index.php文件
- Apache隐藏index.php报错Internal Server Error
- 虚拟空间iis环境下如何隐藏index.php
- Debian8环境下thinkphp框架隐藏index.php
- 虚拟空间iis环境下如何隐藏index.php
- yii 隐藏index.php
- Codeforces 437D The Child and Zoo(贪心+并查集)
- Hibernate基础:快速入门(7):查询数据
- Hadoop中的FileStatus、BlockLocation、LocatedBlocks、InputSplit
- 如何在JDBC中使用.properties文件配置驱动
- Cannot assign requested address: JVM_Bind
- 【laravel】laravel5环境隐藏index.php后缀(apache)
- angularJS路由学习1
- 顺序表及基本运算 && 在表头插入生成单链表 && 在表尾插入生成单链表
- 轻松理解CRC差错检测算法(A PAINLESS GUIDE TO CRC ERROR DETECTION ALGORITHMS)四
- CooCox使用printf编译出错
- C++ 虚函数使用注意点 与 多态的关系
- AngularJS之——页面部分被某重复使用
- LeetCode-Array-119. Pascal's Triangle II
- 得心