共 25 篇文章 |
|
启用apache目录浏览功能。以下是apache的配置记录: 在http.conf中加入如下代码(如有虚拟主机配置,加载到虚拟主机配置段内)1 Alias /dist "I:/build/dist"2 <Directory "I:/build/dist">3 #开启目录列表索引模式4 Options Indexes5 Order allow,deny6 IndexOptions NameWidth=25 Charset=UTF-8 7 Allow from al... 阅42 转0 评0 公众公开 15-10-02 06:51 |
Aapache 启动不了,报错信息:suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) 阅2113 转15 评0 公众公开 15-10-01 23:45 |
Apache的rewrite详解Apache的rewrite模块,提供了一个基于规则的重写(rewrite,也许译为重构更为合适)引擎,来实时重写发送到Apache的请求URL。RewriteCond %{HTTP_USER_AGENT} ^Mozilla.*RewriteRule ^/$ /homepage.max.html [L]RewriteCond %{HTTP_USER_AGENT} ^Lynx.*RewriteRule ^/$ /homepage.min.html [L]RewriteRule ^/$ /homepage.std.h... 阅1128 转3 评0 公众公开 15-09-24 00:50 |
Apache的环境变量。尽管这些变量也被称作环境变量,但它们和底层的、由操作系统控制的环境变量不能混为一谈。标准CGI变量。除了所有Apache配置中的环境变量和由操作系统shell传进来的环境变量之外,还有一组环境变量是提供给CGI脚本和SSI页面的,此组环境变量包含由CGI规范要求的与请求相关的元信息。如前所述,递给CGI脚本的环境变量,除了在A... 阅1767 转0 评0 公众公开 15-09-22 20:40 |
apache配置<Files> <FilesMatch> <Location><LocationMatch>指令。Include /usr/local/apache2/conf/ssl.confInclude /usr/local/apache2/conf/vhosts/*.conf.root@host# apachectl configtestProcessing config file: /usr/local/apache2/conf/ssl.confProcessing config file: /usr/local/apache2/conf/vhosts/vhost... 阅1627 转1 评0 公众公开 15-09-22 02:09 |
观察两个日志文件不同地方是:1:在.htaccess里面判断的条件有前缀如:[perdir D:/Tomcat/webapps/ROOT/]2: RewriteCond: input=''D:/Tomcat/webapps/ROOT/a.html'' pattern=''!-s'' => not-matchedinput是个绝对路径而在http.conf里面的是个相对路径如: RewriteCond: input=''/a.html''... 阅27 转0 评0 公众公开 15-09-20 22:21 |
Apache的RewriteRule规则详细介绍。例子: *U( 1iv0 nRewriteEngine On QWU5-p9e 8RewriteBase /test Q3 K ;kSRewriteCond %{REQUEST_FILENAME}.php -f rU/-Wq` BRewriteRule ([^/]+)$ /test/$1.php ?7r mw y\#for example: /test/admin => /test/admin.php I v80,hWRewriteRule ([^/]+)\.html$ /test/$1.php [L] aufcd57#for example: /tes... 阅59 转0 评0 公众公开 15-09-20 19:33 |
.htaccess基本语法和应用。处理移动过的文件Redirect301 /old.html http://yoursite.com/new.html# 也可以是下面这样RewriteRule /old.html http://yoursite.com/new.html[R=301,L]# 如果想隐式跳转(URL地址不变,但实际上内容是其他URL的),就使用下面的RewriteRule /old.html http://yoursite.com/new.html [L] 阅183 转0 评0 公众公开 15-09-20 14:59 |
RewriteCond指令格式。RewriteCond指令定义一条规则条件。‘=CondPattern’ (等于)将condPattern当作一个普通字符串,将它和TestString进行比较,当TestString与CondPattern完全相同时为真.如果CondPattern只是 “” (两个引号紧挨在一起) 此时需TestString为空字符串方为真。例如: RewriteCond %{REMOTE_HOST}^host1.* [OR] RewriteCond %{RE... 阅105 转0 评0 公众公开 15-09-20 14:57 |
在一条RewriteRule指令前面可能会有一条或多条RewriteCond指令,只有当RewriteCond的条件(CondPattern)匹配成功时,RewriteRule的重写规则才被应用于当前URL处理。RewriteRule ^cat-([0-9]+)-([0-9]+)\.html$cat.php?比如:http://www.andelse.cn/cat-zbc2ac-3-5.html ->http://www.andelse.cn/cat.php?id0=zbc2ac&id1=3&id2=5.比如... 阅17 转0 评0 公众公开 15-09-20 14:53 |