*******************************************************************************
Apache 服务器
*******************************************************************************
● 配置
1、找到Apache配置文件:httpd.conf
2、在文件httpd.conf中->找到以下内容:如果有前面有“#”,就去掉
#LoadModule rewrite_module modules/mod_rewrite.so
 
3、在文件httpd.conf中->加入以下内容:注意将 "/Sites/test" 替换为您的项目根目录
<Directory "/Sites/test">
Options FollowSymLinks
AllowOverride All
</Directory>
 
4、配置URL rewrite规则文件名:找到以下内容(不同环境的内容可能不一致,但最终是在<Files …></Files>之间的)
<Files ".ht*">
Require all denied
</Files>
<Files ~ “^\.htaccess”>
Order allow,deny
Deny from all
</Files>
 
5、保存文件,并 重启Apache服务器
 
● 规则
至于规则,这里只例举了一些全局的,更多规则请至百度详情
allow from 127.0.0.     #允许某个ip段
deny from 127.0.0.     #禁止某个ip段
allow from all      #允许所有
deny from all      #禁止所有
 
 

Apache 支持.htaccess的更多相关文章

  1. PHP如何让apache支持.htaccess 解决Internal Server Error The server …错误

    TP框架  打开 www.newtp.com/index.php/Home/Index/abc出现 如下错误: Internal Server Error The server encountered ...

  2. phpstudy APACHE支持.htaccess以及 No input file specified解决方案

    APACHE支持.htaccess以及 No input file specified解决方案 你的Apache安装文件夹conf里找到httpd.conf文件 索LoadModule rewrite ...

  3. 如何让apache支持.htaccess 解决Internal Server Error The server …错误

    如何让apache支持.htaccess 解决Internal Server Error The server …错误 文章来源:小灰博客| 时间:2013-12-25 12:17:08| 作者:Le ...

  4. Apache支持.htaccess配置方法

    打开httpd.conf文件用文本编辑器打开后,查找  代码如下 复制代码 Options FollowSymLinks AllowOverride None 改为: Options FollowSy ...

  5. 让apache支持htaccess文件

    第一:检测 apache是否开启mod_rewrite 通过php提供的phpinfo()函数查看环境配置,在"apache2handler -> Loaded Modules&quo ...

  6. Linux启动Apache支持.htaccess伪静态文件方法

    第一.编辑httpd.conf文件 A - 在etc/httpd/conf/目录下的httpd.conf 文件,找到: LoadModule rewrite_module modules/mod_re ...

  7. APACHE支持.htaccess以及 No input file specified解决方案

    在你的Apache安装文件夹conf里找到httpd.conf文件 搜索LoadModule rewrite_module modules/mod_rewrite.so 如果前面有注释符号#,请去掉. ...

  8. apache 支持.htaccess重写url

    1. httpd.conf 添加: <Directory /> Options +Indexes +FollowSymLinks +Multiviews AllowOverride all ...

  9. APACHE支持.htaccess

    需要开启.htacess功能需要以下三步: 1 2 3 4 5 6 7 8 9 1.打开httpd.conf 将Options FollowSymLinks  AllowOverride None  ...

随机推荐

  1. hdoj 2147 kiki's game【博弈】

    kiki's game Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 40000/10000 K (Java/Others)Total ...

  2. php 获取目录下文件列表

    可以用 scandir() 函数 例如: http://www.w3school.com.cn/php/func_directory_scandir.asp

  3. wpf DataGrid CheckBox列全选

    最近在wpf项目中遇到当DataGrid的header中的checkbox选中,让该列的checkbox全选问题,为了不让程序员写自己的一堆事件,现写了一个自己的自定义控件 在DataGrid的 &l ...

  4. ASP.NET性能优化之分布式Session

    如果我们正在使用Session,那么构建高性能可扩展的ASP.NET网站,就必须解决分布式Session的架构,因为单服务器的SESSION处理能力会很快出现性能瓶颈,这类问题也被称之为Session ...

  5. git 远程追踪

    $ git branch --set-upstream-to origin/master http://stackoverflow.com/questions/21729560/how-to-make ...

  6. Linq扩展方法之All 、Any

    // Summary: // 确定序列中的所有元素是否满足条件. // Parameters: // source:包含要应用谓词的元素的 System.Collections.Generic.IEn ...

  7. 浅谈href 和 src的区别

    href 表示超文本引用(hypertext reference),在 link.a 等元素上.src 表示来源地址,在 img.script.iframe 等元素上.src 的内容,是页面必不可少的 ...

  8. A的ascll吗是多少?

    //输入一个字符,返回他的ascll码 #include<stdio.h> int main() { char a; while(scanf("%c",&a)! ...

  9. PHP 进制问题

    PHP有一些函数提供进制之间的转化问题 在Math函数中有一部分: decbin() - 十进制转换为二进制 bindec() — 二进制转换为十进制 octdec() - 八进制转换为十进制 hex ...

  10. Java SE (1)之 JFrame 组件 BorderLayout 布局

    JAVA 初期,练习SE ,桌面程序, package com.sunzhiyan; import java.awt.*; import java.awt.event.*; import javax. ...