【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 ...
随机推荐
- K3 LEDE固件更改FRP客户端版本
1.下载文件 /usr/bin/wget --no-check-certificate https://github.com/fatedier/frp/releases/download/v0.23. ...
- libcurl库的http get和http post使用【转】
一.libcurl中的http get使用方法 1. 为什么要使用libcurl 1) 作为http的客户端,可以直接用socket连接服务器,然后对到的数据进行http解析,但要分析协议头,实现代理 ...
- Triangle leetcode java
题目: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjace ...
- 热修复 AndFix 阿里 apkpatch MD
Markdown版本笔记 我的GitHub首页 我的博客 我的微信 我的邮箱 MyAndroidBlogs baiqiantao baiqiantao bqt20094 baiqiantao@sina ...
- MFC增强----任务对话框CTaskDialog类
/** 注意:从Windows Vista系统才开始支持CTaskDialog类,所以在使用时最好调用 CTaskDialog::IsSupported() 方法做判断 同时:CTaskDialog类 ...
- windows 使用 xxfpm 解决 php-cgi 进程自动关闭
windows 下 php-cgi 进程处理一定数量的访问后,就会自动关闭,由于没办法直接让 php-cgi 进程支持更多的访问数量,所以只能启动多个进程来满足需求. xxfpm 是一个可执行程序,它 ...
- 学习世界模型,通向AI的下一步:Yann LeCun在IJCAI 2018上的演讲
https://baijiahao.baidu.com/s?id=1606296521706399213&wfr=spider&for=pc 机器之心整理,机器之心编辑部. 人工智能顶 ...
- Idea不能新建package的解决
右键–>new –> Mark Directory As –> Sources Root (idea需要修改一下目录的性质,改为源文件 )
- C# 源码 AForge.NET
AForge.NET是一个专门为开发者和研究者基于C#框架设计的,他包括计算机视觉与人工智能,图像处理,神经网络,遗传算法,机器学习,模糊系统,机器人控制等领域.这个框架由一系列的类库组成.主要包括有 ...
- Android 之 沉浸式状态栏及顶部状态栏背景色设置
现在很多应用都引用了沉浸式状态栏,如QQ,效果下图: 效果很酷炫,其实设置也很简单.但是,需要注意的是,这种效果只能在API19以及以上版本中才能够做到. 方法一: 首先,如果想让界面Activity ...