我在apache中的httpd.conf文件中加入:RewriteEngine On
RewriteRule ^article_key_list(.*).htm$ article_key_list.php
想得到 在url中输入 article_key_list.html 读取article_key_list.php 文件 但是url显示的是 article_key_list.html但是 我重启apache 报错, 不知道这段代码对不对, 小弟弟新手,哪位高手 帮我看看吧
RewriteRule ^article_key_list(.*).htm$ article_key_list.php
想得到 在url中输入 article_key_list.html 读取article_key_list.php 文件 但是url显示的是 article_key_list.html但是 我重启apache 报错, 不知道这段代码对不对, 小弟弟新手,哪位高手 帮我看看吧
Directory下加上
rewriteengine on
rewritebase /
RewriteRule ^article_key_list(.*).htm$ article_key_list.php
而且要有
LoadModule rewrite_module libexec/mod_rewrite.so
Addmodule mod_rewrite.c还报错的话你就去看日志吧
RewriteRule ^article_key_list.html$ article_key_list.php
现在我在httpd.conf里面加入
rewriteengine on
rewritebase /
RewriteRule ^article_key_list(.*).htm$ article_key_list.php 然后启动就会报错 说 Rewriteengine on 这里错误!
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
RewriteEngine On
RewriteRule ^article_key_list.html$ article_key_list.php
</Directory>
^article_key_list(.*).htm$
^article_key_list(.*).html$
按照这个匹配不会出错的,不过LZ是想匹配htm哪还是html哪
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
RewriteEngine On
RewriteRule ^article_key_list.html$ article_key_list.php
</Directory> 不知道为什么 输入http://localhost:81/article_key_list.html 报错 找不到页面http://localhost:81/article_key_list.php 是没问题的