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

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

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

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

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

<Directory /var/www/html/zkteco/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

4 . 重启Apache

/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. SpringSecurity-ChannelProcessingFilter的作用

    ChannelProcessingFilter决定的是web请求的通道,即http或https. 在springsecurity配置文件中添加这样一行 <intercept-url patter ...

  2. C++中函数的形参为数组时,实质形参是指针

    C++中函数的形参如果为数组的话,那么进行实参传递时,实参实际上换转化成指针.参考下面的例子: #include<iostream> using namespace std; void f ...

  3. 问题 H: 老管家的忠诚(线段树)

    问题 H: 老管家的忠诚 时间限制: 0 Sec  内存限制: 128 MB提交: 54  解决: 21[提交][状态][讨论版][命题人:外部导入] 题目描述         老管家是一个聪明能干的 ...

  4. 1118 Birds in Forest (25 分)

    1118 Birds in Forest (25 分) Some scientists took pictures of thousands of birds in a forest. Assume ...

  5. [UE4]自定义结构体、类、数据表

    自定义数据表: #pragma once #include "CoreMinimal.h" #include "Engine/UserDefinedStruct.h&qu ...

  6. Access、SQLServer、Oracle常见SQL语句应用区别

    Access.SQLServer.Oracle常见SQL语句应用区别 关劲松 PMP 如果要兼容Access.SQL Server.Oracle三个数据库版本:我们在编写SQL语句的过程中,尽量使用一 ...

  7. AD中常用的命令

    1:查看客户机使用哪台DC进行登录的:在客户端cmd下运行 set命令可以查看使用哪台DC登录. 2:使用命令把客户端加入到域 netdom join  fs01 /domain:contoso.co ...

  8. MySQL 之 MyTop实时监控MySQL

    CentOS下使用MyTop实时监控MySQL MyTop的项目页面为:http://jeremy.zawodny.com/mysql/mytop/ MyTop安装 安装依赖包  yum instal ...

  9. 在线学习和在线凸优化(online learning and online convex optimization)—FTL算法5

    最自然的学习规则是使用任何在过去回合中损失最小的向量. 这与Consistent算法的精神相同,它在在线凸优化中通常被称为Follow-The-Leader,最小化累积损失. 对于任何t: 我们谈到了 ...

  10. c#语言函数

    class Program {访问修饰符 函数名(参数1,参数2){   函数体   return 返回值} 无参数,无返回值 public static void abc()             ...