1. 在项目更目录下新建 .htaccess

  1. <IfModule mod_rewrite.c>
  2. Options +FollowSymlinks -Multiviews
  3. RewriteEngine On
  4.  
  5. RewriteCond %{REQUEST_FILENAME} !-d
  6. RewriteCond %{REQUEST_FILENAME} !-f
  7. RewriteCond $1 !^(static|upload)
  8. RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
  9. </IfModule>

2. 修改 /etc/apache2/apache2.conf  (160行左右)

  1. <Directory /var/www/>
  2. Options Indexes FollowSymLinks
  3. AllowOverride All
  4. Require all granted
  5. </Directory>

3 . 修改虚拟站点中配置文件 /etc/apache2/sites-available/eko.conf (eko.conf根据实际情况变化)

  1. <Directory /var/www/html/zkteco/public>
  2. Options Indexes FollowSymLinks MultiViews
  3. AllowOverride All
  4. Order allow,deny
  5. allow from all
    </Directory>

4 . 重启Apache

  1. /etc/init.d/apache2 restart

[记录] Linux Apache隐藏index.php的更多相关文章

  1. linux服务器中Apache隐藏index.php失败

    可以通过URL重写隐藏应用的入口文件index.php,下面是相关服务器的配置参考: [Apache] httpd.conf配置文件中加载了mod_rewrite.so模块 AllowOverride ...

  2. Apache 隐藏 index.php,如将 tp5.com/index.php/hello/123 变成 tp5.com/hello/123

          以Apache为例,需要在index.php入口文件的同级添加.htaccess文件,内容如下: <IfModule mod_rewrite.c> Options +Follo ...

  3. apache 隐藏 index.php

    在根目录下添加文件 .htaccess <IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteC ...

  4. ThinkPHP CI codeignitor 框架 apache 重写 url 隐藏index.php 服务器 报错:Object not found! 可能是.htaccess隐藏index.php

    隐藏index.php可以去掉URL地址里面的入口文件index.php,但是需要额外配置WEB服务器的重写规则.以Apache为例,需要在入口文件的同级添加.htaccess文件(官方默认自带了该文 ...

  5. centos apache 隐藏和伪装 版本信息

    1.隐藏Apache版本信息 测试默认 apache 的状态信息[root@1314it conf]# curl -Is localhostHTTP/1.1 200 OKDate: Tue, 16 N ...

  6. Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)

    Centos下安装配置LAMP(Linux+Apache+MySQL+PHP)   关于LAMP的各种知识,还请大家自行百度谷歌,在这里就不详细的介绍了,今天主要是介绍一下在Centos下安装,搭建一 ...

  7. linux+apache+mod_python+wechat_sdk搭建微信公共账号服务器

    linux+apache+mod_python+wechat_sdk搭建微信公共账号服务器 转载请注明本文原作者:FignerLiu PRE 最近尝试了下使用python搭建微信公共账号服务器,实现了 ...

  8. CI 框架隐藏index.php-ubuntu

    和朋友在做一个小网站,用到了CI框架,之前测试都是在windows上,隐藏index.php也相对比较简单.但服务器是ubuntu系统,需要配置一下,根据网上看到的一些教程,结合自己电脑的特点,记录步 ...

  9. Linux +apache+fastcgi运行c/c++

    在Linux上搭建apache+fastcgi环境,说多了都是泪啊. 花费我几天时间,开源软件虽说好用,但是版本众多,文档缺乏,什么都只能自己摸索. 终于成功运行起来,特此记录. 一. apache ...

随机推荐

  1. Java8新特性值Lambda --->匿名函数

    Lambda:表达式(lambda expression)是一个匿名函数,Lambda表达式基于数学中的λ演算得名,直接对应于其中的lambda抽象(lambda abstraction),是一个匿名 ...

  2. 求1~n整数中1出现的次数(《剑指offer》面试题43)

    题意: 给定一个整数n,求1~n这n个整数中十进制表示中1出现的次数. 思路: 方法1:最直观的是,对于1~n中的每个整数,分别判断n中的1的个数,具体见<剑指offer>.这种方法的时间 ...

  3. C# name scheme

    1.For varibale.camel scheme.the first word lowercase the first letter,then other words capitalize th ...

  4. Java自定义数据验证注解Annotation

    本文转载自:https://www.jianshu.com/p/616924cd07e6 Java注解Annotation用起来很方便,也越来越流行,由于其简单.简练且易于使用等特点,很多开发工具都提 ...

  5. random.sample函数

    import random list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] for i in range(3): slice = random.sample(list, ...

  6. Ubuntu 14.10 下HBase错误集

    1 如果机群时间不同步,那么启动子节点RegionServer就会出问题 aused by: org.apache.hadoop.hbase.ipc.RemoteWithExtrasException ...

  7. 切换了webview 定位不了的解决方法 (还没有试,记录在此)

    # 切换到 webview time.sleep(2) print(driver.contexts) driver.switch_to.context('WEBVIEW_com.tencent.mm: ...

  8. Java学习——使用final修饰符

    package Pack1; import java.awt.*; import java.applet.*; class ca { static int n = 20; final int nn; ...

  9. get和post的解析

    get 直接获取数据 post 将数据发送到服务端缓存下来,当无法缓存数据或用户输入未知字符时用post, get:常用于数据 post:不想缓存数据,不再浏览器中缓存数据,在服务端可以,因为取数据及 ...

  10. [UE4]Set Array Elem

    用一个新元素替换数组中已有的元素. “Size to Fit”:true,表示如果index参数大于数组所有,将会自动扩展数组大小.