使用.htaccess文件需要注意的地方:

  1、找到配置文件httpd.conf,将override的值改成all。如下图:(如果不设置成all,apache将忽略.htaccess文件)

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAABoCAIAAABT8P02AAAKCElEQVR4nO2d27m0KgxApx4r+HugEgqhEOqY0s7LefBGIEFQx9E9a337YQ8qlwDhogmv14wL0Q8uRP8CAAAAAAAAAAAAAAAAAAC4nsHH6Idv52I/T8n/3fJ5t/zcmMHHd0pw8roL778mShfGgo5F10rnQiGHkkVyqnyqcnPh/X5/8GuapvzfgDWfozCvyrQl/xPk1thfphzYN3b0u+32fB6Dj2s1peJy4brqe718/Eb7Hnwc5euC2li7hp29Y1TTZ3j75POUYTPL52CX1rpyoP0o8r9YbqelprdnF05WIrNeWkOknl3EZ42oY3D0w3zD/HA6eZG1MurEMXyKPp/piA6cXFuD9XSHJfiV/tqUQHCWbIthZ829cnfZ2syZSFLk4JKGq8ZfkU81P+qwucYVY1zSNepLlfOS5tJA16d64qnkc/Ax+CUqrVGlF4zwqXH7pMENSQKq/G25Ke1WBE8J1fuLhY/RuyVLSs1nWvX9focQ1hLIa2p7Pm0KokeUSczQI/kjSytxYa4zWfi5YtJJzKIc5/woI4aPyR0u5DquSHf8kD55fHMUmqeBg49FW1HK61yqvLIHrGGqCE/nnnKqbMevl6UzP0PW5Od0rfpaMpjJWcScNJLeeCr5TAeAljq12o9scOP/tvyN/FjtdpV51pqNeCxEZyyaoiGfNeXkaq09KxOFLmrrn12KozKcSqVYm5MrFV9MWEVSZbpZPMYNzWirXFm0nYojy9jg9ZE/n3lpHaaWH3WVnkxR7JFcxKSLcY18LdyeePR8ippvGwwsxZFpqHE0NuWv58dot/LBupqeY9blo+ezGrMln02Obn+IwXyhqilaFYepIK5QHEv4wU0TrbBil6pchx9WHLX4teLU7t8e7tYZXHWTxZDz0gnfsgnviEdd9J2kOHJJbyoOvd4bFEdZwJ4Zh5ZPO57diiOfBu5DUT1ZO9iaMo13qXsDDe8X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9RI+RV+c3p7mqfTTYaY7LMGv9FfyCNoDoI1Kh1F2NzJNYuiR/JF36edCWIumhy1L3bLeps44dH8ZdrqZJVsep6lAAWBm2BhkSwcaOxWHYq5uGXfZnVZRHHVHPoZXn/UZ44YtsQCAfRiyOX2wNUWr4jAVxBWKYwlXpzDp9AcAamhDrDbdyIPze5oVh/n+RYaL3dc17iTY9NNhpDtHFZw1D0JrAHQgu42uAsxNyla/EsamprKvWd6fRCbnPA35Ud4b5ysuVicAR/nrH2Q0OTUGAHi9Xnc6igkAAAAAAAAAAAAAAAAA/ir/A9shCbSpkcjqAAAAAElFTkSuQmCC" alt="" />

  2、找到配置文件httpd.conf,加载指定的模块,如下图:(一般都是加载了指定模块,然后在配置.htaccess文件才有效)

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAf8AAABzCAIAAAAZlpz+AAANr0lEQVR4nO2d67WrOAxGU08qOD1QSQqhEOpIaffP/UEAPyTziAE52nvNWjOTGFmyZR1D4OPxAAAAgKt5voa3SN81YR+uwdo8WvMHAAAAAAAAAAAAAOAWnq9heD3v9gJgpOtP+NGm69/v9/CarAcJP32w006J+ScoC+tqdMbrj1+tzNddfnZ9ndTY5H8VfOezD7q++krs+jE74/Tp+mEYduXSZGeNW3ZVLymWp/ipF0zPV8ANflYNeav/uyCfPaJV/+DGriABgtOF6LDgPrC+C6p/333yJ/zvgn3JTvhHJDuh+ByUxhDel7ZlqUhxqf1mN73NATxfQ/+av/18/LHT91nzQ/4odvLx3Nfv2HoY+mnsk0OszJdVP5cvhmFIQwg2/vX8L0E+53bieZHH2Rti9X8NwUro+iXRuy5M02VbvzQPzkzHnUPXD6/nmP5z9VfsK3aSPUjmcb5Kww+er2H9D4AcV6lfba8Urqk40ZckXt8G6v6IdrT52tfv3Lrrx3/P4duaL3t+hi27Pv3DkNqp578K+Zy1CedFrW/eEKp/dr63tIm3CZ9WiYnnawirf5Cv4XmAYF+zs3eVCg+krP15F+M6tFrE9mX/v/VHn699/c4D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ou5hWrrcKnW9e6p/o9HdAYaDgf6/kK/p+qSa/1q+t0lUcfvqz86+2t+orNf8ueifD6ud3/Gr+jmQd9/Qo1L7jdxNW07X+6a23+hSy68jToPSvlK1zEv9Ngb0q9vxU/NeXnjX9H/tUHylM/H9e6L1xl/Gm9PP3mLF+4DnX2wjbdq6C1eAAAZb9XQW7wAADLeqqGVeIXb2i65CHlXv1AXa/NozR/YgpVqeBXe4gUAkPn39+ftn7uHHAAAAAAAAFpHuMcfwBzRwxO1fpyxru9/HsszOzVZxqHrLQTayryg478VH3kLEidoXJjW96/FhXroyzjY2FaanpcAdPwFHOctZGjVX9a/bl/fXxuFPC613+zmtkhF62s9dHU8x1XUBQ/NzxIaul68bNmePn4rfqLjX+K8vM3HDb3+7xGr/w/r+yujYEoPXR2HccV8vnpOns5KXplevIze3ta82PMzbImOf+7NuXmrj79ar6CMUP2zSfglfX8ZXdVu7yoq+LltCZXGIVzhS3dzg0wzUg3WnD5+K36i469zdt5+mmbhFuoVlEl0W0vZGatWLa2a0veXMKaHXlpF6TctVf+982LcT3T8M3fOzdusO/T6v0Wo/j+t7y+gxlXq90w9dHUcRicCm9OiqVL9zc6LGT/R8S/5Uzlv0es/lVzG3IG+v4gal9xv4mradr7cNbffrYcujcN4BW10TxjYXtKLL4QqtrczLyb91JyXN/4V/V8bpF/MW/T6AcA66PgDAAAAAAAAQIxwW2HVi5Zn24drsDaP1vwBAACALfwH3e2L0lBEZqoAAAAASUVORK5CYII=" alt="" />

 以下是常用的.htaccess配置:

#去掉网址的index.php字符串
RewriteEngine on
RewriteBase /
RewriteCond %{REGUEST_FILENAME} !-f
RewriteCond %{REGUEST_FILENAME} !-d
#设置public字符串不跳转是要访问资源文件
RewriteRule !^(index.php|public) aaa/index.php [L]
#去掉网址的index.php字符串 #GZIP压缩模块配置
<ifmodule mod_deflate.c>
#启用对特定MIME类型内容的压缩
SetOutputFilter DEFLATE
#设置不要压缩的文件
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png|exe|t?gz|zip|bz2|sit|rar|pdf|mov|avi|mp3|mp4|rm)$ no-gzip dont-vary
#设置要压缩的文件
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-httpd-php application/x-javascript
</ifmodule>
#GZIP压缩模块配置 #文件缓存时间配置
<FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|js|css)$">
Header set Cache-Control "max-age=0"
</FilesMatch>
#文件缓存时间配置

apache的 .htaccess文件的常用配置的更多相关文章

  1. mac下为Apache 创建 .htaccess文件

    标签:mac   .htaccess 在设置固定链接时会提示如下的问题:   若您的 .htaccess 文件可写,我们可以自动修改它.但似乎它不可写,因此我们在下方列出了您 .htaccess 文件 ...

  2. Apache 中 .htaccess 文件设置技巧16则

    .htaccess 文件 (Hypertext Access file) 是Apache Web服务器的一个非常强大的配置文件,对于这个文件,Apache有一堆参数可以让你配置出几乎随心所欲的功能.. ...

  3. 让apache支持htaccess文件

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

  4. apache上.htaccess转向nginx上配置.htaccess伪静态规则

    nginx上配置.htaccess伪静态规则 在apache上.htaccess转向,只要apache编译的时候指明支持rewrite模块即可. 但是换到nginx上方法会有不同,有人说把.htacc ...

  5. apache设置映射文件夹的配置方法

    在apache的配置文件中加入以下配置 Alias /uploadImage F:/upload <Directory F:/upload/UploadFiles>      Option ...

  6. apache的.htaccess文件作用和相关配置

    首先.htaccess什么? .htaccess是一个纯文本文件,它里面存放着Apache服务器配置相关的指令. 当我们使用apache部署一个网站代码准备部署到网上的时候,我们手中的apache的h ...

  7. Apache、tomcat、Nginx常用配置合集

    配置文件地址: Apache: /etc/httpd/conf/httpd.conf tomcat: /usr/local/tomcat/conf/server.xml Nginx  : /usr/l ...

  8. apache使用.htaccess文件中RewriteRule重定向后,URL中的加号无法解析

    今天在使用.htaccess做伪静态的时候,发生一件怪事,URL里存在C++时会有问题,在处理C++这个词的时候,无论如何,$_GET都得不到++,只能得到C空格. 一开始我以为是没用urlencod ...

  9. SSH项目web.xml文件的常用配置【struts2的过滤器、spring监听器、解决Hibernate延迟加载问题的过滤器、解决中文乱码的过滤器】

    配置web.xml(struts2的过滤器.spring监听器.解决Hibernate延迟加载问题的过滤器.解决中文乱码的过滤器) <!-- 解决中文乱码问题 --> <filter ...

随机推荐

  1. Ceph Newstore存储引擎介绍

    在Ceph被越来越多地应用于各项存储业务过程中,其性能及调优策略也成为用户密切关注讨论的话题,影响性能表现关键因素之一即OSD存储引擎实现:Ceph基础组件RADOS是强一致.对象存储系统,其OSD底 ...

  2. FCKEditor的用法与下载

    以下是我初次使用FCKEditor的方法,都是来自网上,但网上都不完整,现在我整理下: 1:下载FCKEditor 下载下来后解压到你网站的目录,最好就放在根目录下,文件夹名字就用FCKEditor: ...

  3. linux之let用法

    shell程序中的操作默认都是字符串操作,在要运行数学运算符的时候可能得到意想不到的答案: var=1 var=$var+1 echo $var output:1+1 从这个例子中可以看出shell字 ...

  4. springmvc前后端传值总结

    1      前端向后端传参 1.1    普通方式传参 1.1.1         页面 参数需要解析成json对象:JSON.parse(JSON.stringify(query)) $.getJ ...

  5. Java_Vector类的使用,以及Stack继承Vector,推出的栈的特性

    测试用例: import java.util.Stack; /* * 简单的栈类测试: * Stack继承自Vector向量类: * 所以Stack的使用和Vector的使用类型的 * 而且是线程安全 ...

  6. Redis多机集群

    Redis集群.网上很多教程,只是按着它的步骤来做只能在单机上跑,而已不有点抗.也不用密码验证 开始: 1:redis集群最少需要要6个服务器端,因此先搞6台虚拟机 我用 centOS-7 mini ...

  7. POJ 1099 Square Ice

    Square Ice Description Square Ice is a two-dimensional arrangement of water molecules H2O, with oxyg ...

  8. OpenJudge 2980 大整数乘法

    链接地址:http://bailian.openjudge.cn/practice/2980/ 题目: 总时间限制: 1000ms 内存限制: 65536kB 描述 求两个不超过200位的非负整数的积 ...

  9. Node.js:JavaScript脚本运行环境

    Node.js https://nodejs.org/ 2016-08-03

  10. CentOS7 IP自动获取

    /etc/sysconfig/network-scripts HWADDR=00:15:5D:00:76:04TYPE=EthernetBOOTPROTO=dhcpDEFROUTE=yesPEERDN ...