CentOs中Apache文件访问去除index.php
0.apache下面和index.php同一个目录下面的 .haccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?s=/$ [QSA,PT,L]
</IfModule>
1.centos的配置文件放在: /etc/httpd/conf/httpd.conf
LoadModule rewrite_module modules/mod_rewrite.so
将前面"#"去掉,如果不存在则添加上句。
2.如果你的网站是根目录的话:找到
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
将上面的None改为All
3.如果你的站点不在根目录,设置如下:
<Directory "/var/www/html/my_directory">
Order allow,deny
Allow from all
AllowOverride All
</Directory>
然后重启服务器,service httpd restart ,这样.htaccess就可以使用了
4.index.php (thinkphp3.2.3版本)
define('__APP__', ''); //将index.php自动隐藏
CentOs中Apache文件访问去除index.php的更多相关文章
- centos中apache自用常用额外配置记录(xwamp)
xwamp套件中apache配置,记录下,以免忘记. 配置路径 ${wwwroot_dir}/conf/httpd.conf 配置内容 <ifmodule mod_deflate.c> D ...
- CentOS中Apache虚拟主机(virtualHost)设置在/home目录下的若干问题
在Ubuntu中安装LAMP是非常简单的意见事情.但是在CentOS中却遇到了很多问题. 首先是CentOS中必须手动配置iptables,把80端口开放出来,不然,是访问不到的,开放80端口在/et ...
- Linux中ls -l(ll)返回结果中的文件访问权限-rw-r--rw-
linux文件访问权限(像rw-r--rw-是什么意思) Linux的文件访问权限分为 读.写.执行三种 r:可读(4) w:可写(2)对目录来说则可新建文件 x:可执行(1)对目录来说则可进入该 ...
- centos7 centos中apache运行php需要连接mysql一直连不上,telnet访问mysql出错Connection closed by foreign host
执行命令: getsebool -a|grep httpd 发现 httpd_can_network_connect off 解决: setsebool httpd_can_network_conn ...
- PHP单一入口apache配置和去除index.php
index : index在互联网上表示网站的默认主页. 一般为 index.html index.htm index.asp index.php: 另外的默认主页也多用default.html;de ...
- 【转】CentOs中Apache开启rewrite模块详解
rewrite是apache环境的一个伪静态功能了,如果我们没有没让Apache开启rewrite功能,网站上所有的rewrite规则都不可使用. centos的配置文件放在: /etc/httpd/ ...
- 解析centos中Apache、php、mysql 默认安装路径
apache:如果采用RPM包安装,安装路径应在 /etc/httpd目录下apache配置文件:/etc/httpd/conf/httpd.confApache模块路径:/usr/sbin/apac ...
- centos 中查找文件、目录、内容
1.查找文件 find / -name 'filename'12.查找目录 find / -name 'path' -type d13.查找内容 find . | xargs grep -ri 'co ...
- 解决Wamp各版本中 Apache 文件列表图标无法显示
Edit the following file manually and change the path to the icons folder (it appears times in the fi ...
随机推荐
- Django基础(三)
Template 不能直接将html硬编码到视图里的原因: 对页面设计进行的任何改变都必须对python 代码进行相应的修改.站点设计的修改往往比底层python 代码的修改要频繁的多,因此如果可以在 ...
- 转:MySQL Row Format(MySQL行格式详解)
MySQL Row Format(MySQL行格式详解) --转载自登博的博客
- maven中maven dependencies中依赖出现了项目
maven 中maven dependencies中依赖出现了项目,把依赖的项目关掉,项目消失,但是还是无法打包 ,出现的错误如图.说明:依赖的项目为project-dao 打包的项目为projec ...
- 四 Mixer
Mixer在应用程序和基础架构后端之间提供通过中介层.它的设计将策略决策移出应用层,用运维人员能够控制的配置取而代之. Mixer的设计目的是改变层次之间的边界,以此降低总体复杂性.从服务代码中剔除策 ...
- The lesser known pitfalls of allowing file uploads on your website
These days a lot of websites allow users to upload files, but many don’t know about the unknown pitf ...
- java 多线程系列基础篇(九)之interrupt()和线程终止方式
1. interrupt()说明 在介绍终止线程的方式之前,有必要先对interrupt()进行了解.关于interrupt(),java的djk文档描述如下:http://docs.oracle.c ...
- C#如何生成JSON字符串?(序列化对象)
第一章:C#如何拿到从http上返回JSON数据? 第二章:C#如何解析JSON数据?(反序列化对象) 第三章:C#如何生成JSON字符串?(序列化对象) 第四章:C#如何生成JSON字符串提交给接口 ...
- Web Api2 中线程的使用
System.Threading.Thread th = new System.Threading.Thread(方法名); th.IsBackground = true; th.Start(); 上 ...
- hbase性能调优(转载)
一.服务端调优 1.参数配置 1).hbase.regionserver.handler.count:该设置决定了处理RPC的线程数量,默认值是10,通常可以调大,比如:150,当请求内容很大(上MB ...
- 基于:Hadoop 2.6.0-cdh5.4.0 hive1.1.0 HBase 1.0.0-cdh5.4.0 关键配置文件
core-site.xml <configuration> <property> <name>fs.defaultFS</name> <value ...