2006/03/13

url转向实例

url转向实例
tags:url转向,apache
#config in httpd.conf in apache2/conf
#1、启用转向功能
LoadModule rewrite_module modules/mod_rewrite.so
#2、设定起始目录
DocumentRoot "D:/htdocs/php"
#3、设定起始页
DirectoryIndex index.html index.html.var index.php
#4、添加页面处理类型
AddType application/x-httpd-php .php
#5、启用目录层次的配置控制
AccessFileName .htaccess
<Directory "D:/htdocs/php">
#...允许.htaccess配置文件
AllowOverride All
#...
</Directory>

#6、配置D:/htdocs/php目录下的.htaccess,
#win下创建此文件需使用cmd模式下的命令行方式echo create > .htaccess
#起始页
DirectoryIndex index.php
#启用重定向引擎
RewriteEngine on
#设定重定向规则
RewriteRule ^feed/([a-zA-Z0-9]*)$ /feedreader/renderfeed.php?brn=$1 [L]
#设定默认处理字符集格式
php_value default_charset UTF-8


--
[:p] --飞扬.轻狂 [fallseir.lee]
http://fallseir.livejournal.com
http://feed.feedsky.com/fallseir

没有评论: