type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
~/(\d*).html
~/user/default.aspx?link=$1
type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
E. 在地址栏输入[url]http://localhost/1.html[/url] 指向[url]http://localhost/user/default.aspx?link=1[/url]
基于Apache HTTP Server 静态化Apache Web Server 的配置(conf/httpd.conf )
A. 在httpd.conf 文件中查找LoadModule rewrite_module modules/mod_rewrite.so
通常该行被注释,去掉“#”。如果没有就增加该行。
B. 加入代码:
RewriteEngine On
RewriteRule ^/([0-9]+).html$ /user.php?user=$1
C. 如果网站使用通过虚拟主机来定义,请务必加到虚拟主机配置文件.htccess 中去,否则可能
无法使用。
D. 重启Apache,重新载入配置。
E. 在地址栏输入[url]http://localhost/1.html[/url] ,实际指向[url]http://localhost/user.php?user=1[/url]
原文:http://www.jb51.net/article/35425.htm