步骤:

下面我说下 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错误)的更多相关文章

  1. CI 框架怎么去掉隐藏入口文件 index.php

    当我重新接触一个框架的时候首先肯定要去掉入口文件,也就是index.php 这个东西在url上很不漂亮,而且每次我访问我的网站的时候都要打进去url里面.这样告诉一个去掉 CI框架里面入口文件的方法, ...

  2. ThinkPHP5.X PHP5.6.27-nts + Apache 通过 URL 重写来隐藏入口文件 index.php

    我们先来看看官方手册给出关于「URL 重写」的参考: 可以通过 URL 重写隐藏应用的入口文件 index.php ,Apache 的配置参考: 1.http.conf 配置文件加载 mod_rewr ...

  3. Apache 隐藏入口文件 index.php

    新建 .htaccess文件至站点目录下,并写入如下代码: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQ ...

  4. apache隐藏入口文件index.php

    LoadModule rewrite_module modules/mod_rewrite.so

  5. CI隐藏入口文件index.php

    1.需要apache打开rewrite_module,然后修改httpd.conf的AllowOverride none 为AllowOverride All(里面,不同的环境目录不同) 2.在CI的 ...

  6. nginx隐藏入口文件index.php

    网站的访问url可能是这样http://www.xxx.com/index.php/home/index/index 这种有点不美观,我们想达到如下效果http://www.xxx.com/home/ ...

  7. TP5 隐藏入口文件 index.php

    找到public下的.htaccess <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine ...

  8. niginx隐藏入口文件index.php

    location / { if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$ last; break; } }

  9. Nginx配置 隐藏入口文件index.php

    Nginx配置文件里放入这段代码 server { location / { index index.php index.html index.htm l.php; autoindex on; if ...

随机推荐

  1. 再看copy_on_write缩小临界区的例子

    本例子是模拟的读者写者问题,采用shared_ptr+写时拷贝实现,其中我觉得一个比较值得注意的地方是考虑到对象可能在临界区析构而将析构移除临界区,这对于多线程来说要多看多思. #include< ...

  2. SharePoint _layouts下自定义程序页面权限管理

    在sharepoint中,_layouts下的自定义页面没有特别的权限,只要用户能访问sharepoint站点就可以访问_layouts下的自定义程序页面,现在我们需要给自定义页面做一下权限认证.要求 ...

  3. 构造读写IRP(转)

    DDK示例中的代码. NTSTATUSFltReadSectors(  IN PDEVICE_OBJECT DeviceObject,  OUT PVOID Buffer,  IN ULONG Len ...

  4. 记录Activity启动时间 ActivityLifecycleCallbacks

    ActivityStackManager 定义一个集合(Stack)保存所有还未销毁的 Activity public class ActivityStackManager { private Sta ...

  5. TensorFlow教程——Bi-LSTM+CRF进行序列标注(代码浅析)

    https://blog.csdn.net/guolindonggld/article/details/79044574 Bi-LSTM 使用TensorFlow构建Bi-LSTM时经常是下面的代码: ...

  6. Kafka:ZK+Kafka+Spark Streaming集群环境搭建(十一)定制一个arvo格式文件发送到kafka的topic,通过Structured Streaming读取kafka的数据

    将arvo格式数据发送到kafka的topic 第一步:定制avro schema: { "type": "record", "name": ...

  7. JPA(六):映射关联关系------映射单向一对多的关联关系

    映射单向一对多的关联关系 新建项目项目请参考<JPA(二):HellWord工程>,基于上一章讲解的<JPA(五):映射关联关系------映射单向多对一的关联关系>中的例子进 ...

  8. Create root user on MongoDB

      db.createUser( { user: "user", pwd: "pass", roles: [ "root" ] } );   ...

  9. nova network工作原理及配置

    1. nova network简介 网络管理和配置是云计算中一项非常重要的功能.nova自带的nova-network实现了一些基本的网络模型,允许虚拟机之间的相互通信及虚拟机对internet的访问 ...

  10. javascript设计思维

    //一.把参数当作私有变量使用 (function (a, b) { //把参数当作私有变量使用,省略了var,也节省了行数 console.log(b) //undefined,所有未赋值的变量均为 ...