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 ...
随机推荐
- 机器学习:PCA(基础理解、降维理解)
PCA(Principal Component Analysis) 一.指导思想 降维是实现数据优化的手段,主成分分析(PCA)是实现降维的手段: 降维是在训练算法模型前对数据集进行处理,会丢失信息. ...
- java中内部类的讲解
java中有一个内部类的概念,由于之前一直比较忙,没有单独拿出时间总结一下,今天我就把内部类的相关知识进行一下汇总,如果有不足之处,欢迎批评指正. 1)java内部类的概念. 在一个类的的 ...
- JavaScript中给对象添加方法
在JavaScript中,我们经常要给已定义的对象添加一些方法,如下: function circle(w,h){ this.width=w; this.height=h; ...
- 10-17C#第四部分--类型(1)
C#类型--String类 一.String类型 () 注:string与String的不同:string属于String的数据类型,小写string是大写String类型的实例化:string属于S ...
- JDBC批处理数据
JDBC3.0 的增强支持BLOB,CLOB,ARRAY,REF数据类型.的ResultSet对象UPDATEBLOB(),updateCLOB(),updateArray()和updateRef( ...
- xcode 编译错误找不到 libz.dylib
图片对应的是libxml2.dylib (libz.dylib 遇到的编译错误跟这个类似) 解决方法是在引入库的地方调整原先 比如libz.dylib 的目录: ================== ...
- 利用powerdesigner创建表模型后导出sql语句方法,以及报错 Generation aborted due to errors detected during the verification of the model.的解决办法
今天用powerdesigner建了表模型,下面先说一下导出sql语句的步骤. 1.选项 2. 然后就报错了,下面说解决办法,很简单. 你没看错,把模型检查的√去掉就行了~~ 导出表名不带双引号的设置 ...
- bzoj 2653 middle(主席树)
题面:https://vjudge.net/problem/HYSBZ-2653 博客:https://blog.csdn.net/litble/article/details/78984846 这个 ...
- Swing的MVC结构
--------------siwuxie095 工程名:TestMVC 包名:com.siwuxie095.mvc 类名:Test.java ...
- koa1链接mongodb
1.项目下安装mongodb和mongoose npm install mongodb --save-dev npm install mongoose --save-dev 2.router中 var ...