【apache】phpstudy中apache 隐藏入口文件index.php (解决no input file specified错误)
步骤:
下面我说下 apache 下 ,如何 去掉URL 里面的 index.php
例如: 你原来的路径是: localhost/index.php/Index/index
改变后的路径是: localhost/Index/index
1.httpd.conf配置文件中加载了mod_rewrite.so模块 //在APACHE里面去配置
#LoadModule rewrite_module modules/mod_rewrite.so把前面的警号去掉
2.在APACHE里面去配置 ,将里面的AllowOverride None都改为AllowOverride All
注意:修改之后一定要重启apache服务。
3.确保URL_MODEL设置为2, (url重写模式)
在项目的配置文件里写
return Array(
‘URL_MODEL’ => ’2′,
);
4 新建文件名为 .htaccess 的文件,放于根目录下,内容如下:
方法一:在RewriteRule后面的index.php之后加?(建议)
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L] </IfModule>
或者方法二:(不建议)
在php.ini中找到
;cgi.force_redirect = 1
去掉前面的分号并且把后面的1改为0
【apache】phpstudy中apache 隐藏入口文件index.php (解决no input file specified错误)的更多相关文章
- CI 框架怎么去掉隐藏入口文件 index.php
当我重新接触一个框架的时候首先肯定要去掉入口文件,也就是index.php 这个东西在url上很不漂亮,而且每次我访问我的网站的时候都要打进去url里面.这样告诉一个去掉 CI框架里面入口文件的方法, ...
- ThinkPHP5.X PHP5.6.27-nts + Apache 通过 URL 重写来隐藏入口文件 index.php
我们先来看看官方手册给出关于「URL 重写」的参考: 可以通过 URL 重写隐藏应用的入口文件 index.php ,Apache 的配置参考: 1.http.conf 配置文件加载 mod_rewr ...
- Apache 隐藏入口文件 index.php
新建 .htaccess文件至站点目录下,并写入如下代码: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQ ...
- apache隐藏入口文件index.php
LoadModule rewrite_module modules/mod_rewrite.so
- CI隐藏入口文件index.php
1.需要apache打开rewrite_module,然后修改httpd.conf的AllowOverride none 为AllowOverride All(里面,不同的环境目录不同) 2.在CI的 ...
- nginx隐藏入口文件index.php
网站的访问url可能是这样http://www.xxx.com/index.php/home/index/index 这种有点不美观,我们想达到如下效果http://www.xxx.com/home/ ...
- TP5 隐藏入口文件 index.php
找到public下的.htaccess <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine ...
- niginx隐藏入口文件index.php
location / { if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$ last; break; } }
- Nginx配置 隐藏入口文件index.php
Nginx配置文件里放入这段代码 server { location / { index index.php index.html index.htm l.php; autoindex on; if ...
随机推荐
- 2.1 jdk-spi的实现原理
dubbo-spi是在jdk-spi的基础上进行重写优化,下面看一下jdk-spi. 一.作用 为接口自动寻找实现类. 二.实现方式 标准制定者制定接口 不同厂商编写针对于该接口的实现类,并在jar的 ...
- 4个设计绝招教你减少PCB板电磁干扰
电子设备的电子信号和处理器的频率不断提升,电子系统已是一个包含多种元器件和许多分系统的复杂设备.高密和高速会令系统的辐射加重,而低压和高灵敏度 会使系统的抗扰度降低. 因此,电磁干扰(EMI)实在是威 ...
- ajax file upload 修改
先前 写过 JS 判断上传 文件 大小 后来发现一个问题, 就是单页面运行 js 没有问题, 但是基础呢个到项目中 有些时候 obj_img.dynsrc = file.value; 报错说没有 权限 ...
- Hadoop家族学习路线、实践案例
作者:Han Hsiao链接:https://www.zhihu.com/question/19795366/answer/24524910来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商 ...
- linux命令学习——cat
1.前言 今天需要处理一个oui.txt文件,需要从中抽丝man和orginaziton信息,导出到另外一个文件中.可以cat和grep命令进行操作.之前对cat命令了解一下,知道cat可以查看文件内 ...
- webkit-user-select:none 问题
webkit-user-select:none 问题 学习了:https://bugs.webkit.org/show_bug.cgi?id=82692 最近两天做移动端游戏举报页面.遇到一个问题,移 ...
- How could I create a custom windows message?
[问题] Our project is running on Windows CE 6.0 and is written in C++ . We have some problems with the ...
- oracle 嵌套查询
select dat.id, dat.voucher_id, dat.type, dat.state, dat.start_point, dat.start_floor, dat.end_point, ...
- 【Nodejs】使用request批量下载MP3,文件数量内容都没问题
看来request远强于http.request是毋庸置疑的了. 代码如下: //====================================================== // 喜 ...
- redis 安装报错
CentOS 6.5 安装 Redis 执行 make #error "Newer version of jemalloc required" 根据你系统安装时或之后安装的选项的情 ...