laravel无法正确路由,开启Apache mod_rewrite模块
来源:互联网 发布:c语言体会 编辑:程序博客网 时间:2024/06/05 09:59
具体情况:
routes.php中Route::controller('/' , 'testController');TestController.php中public function getIndex(){ $value = Config::get('app.timezone'); echo $value;}这里是控制器路由,也就是说分别在访问http://localhost:1000http://localhost:1000/index时 都应该显示TestController中的getIndex方法但实际访问时,却无法访问http://localhost:1000/abort会出现错误 如下Not FoundThe requested URL /abort was not found on this server.Apache/2.4.9 (Win32) PHP/5.5.12 Server at localhost Port 1000这是用apache做服务器时发生的情况如果用php内置服务器 则没有出现类似的问题
解决方案:
在apache的http.config中把LoadModule rewrite_module modules/mod_rewrite.so前面的*去掉这里的意思是开启Apache mod_rewrite模块作用是通过http://localhost:8080/php/访问时,/php/和其下面的子目录将支持url rewrite。Rewirte主要的功能就是实现URL的跳转和隐藏真实地址,基于Perl语言的正则表达式规范。平时帮助我们实现拟静态,拟目录,域名跳转,防止盗链等
参考资料:
http://wenda.golaravel.com/question/993http://www.php100.com/html/webkaifa/apache/2010/0228/4006.htmlhttp://bbs.php100.com/simple/?t300372.html
0 0
- laravel无法正确路由,开启Apache mod_rewrite模块
- 开启Apache mod_rewrite模块
- openSUSE 11.2 开启 apache mod_rewrite 模块
- 开启Apache mod_rewrite模块完全解答
- 开启Apache mod_rewrite模块完全解答
- 开启Apache mod_rewrite模块完全解答
- Ubuntu Apache2开启mod_rewrite解决laravel路由失效问题
- Ubuntu开启Mod_rewrite模块
- Apache下开启mod_rewrite
- Apache 开启 mod_rewrite
- Apache如何开启Mod_rewrite模块以及Wordpress伪静态
- Apache如何开启Mod_rewrite模块以及Wordpress伪静态
- Apache模块 mod_rewrite
- Apache模块mod_rewrite详解
- apache添加mod_rewrite模块
- Apache mod_rewrite模块配置
- Apache模块 mod_rewrite
- Apache模块mod_rewrite
- OpenGL 基础第三方包配置
- Android相机启动加速
- React Native androd 错误`View` has no propType for native prop
- 高斯模糊的算法
- Huffman编码树
- laravel无法正确路由,开启Apache mod_rewrite模块
- Http协议介绍
- 构建模式、视图控制器、项目说明(Xcode使用说明2)
- 深度神经网络结构以及Pre-Training的理解
- Veloview阅读笔记2
- 利用反射简单模拟Spring的控制反转(Ioc)和依赖注入(DI)
- 关于c调用lua 对‘luaL_newstate()’未定义的引用的问题解决办法
- 关于java.lang.UnsupportedClassVersionError解决方法总结
- BZOJ1001(最小割,Dinic的优化)