有没有办法让Apache提供名称中带有问号的文件?

有没有办法让Apache提供名称中带有问号的文件?,apache,Apache,我使用wget-m-k-E刮取了一堆页面。结果文件的名称格式为foo.php?bar.html。阿帕奇猜到了之后的一切?是一个查询字符串,有没有办法告诉它忽略该字符串?作为查询字符串分隔符(请将foo.php?bar.html作为请求的文件,而不是foo.php) 要节省您访问wget手册页的时间: -m:递归镜像 -E:foo.php?bar变成foo.php?bar.html -k:转换页面中的链接(foo.php?bar现在链接到所有页面中的foo.php?bar.html,以便它们正确显

我使用wget-m-k-E刮取了一堆页面。结果文件的名称格式为foo.php?bar.html。阿帕奇猜到了之后的一切?是一个查询字符串,有没有办法告诉它忽略该字符串?作为查询字符串分隔符(请将foo.php?bar.html作为请求的文件,而不是foo.php)

要节省您访问wget手册页的时间:
-m:递归镜像
-E:foo.php?bar变成foo.php?bar.html

-k:转换页面中的链接(foo.php?bar现在链接到所有页面中的foo.php?bar.html,以便它们正确显示)

是否会转义?正如%3F所做的那样?

ApacheV1用来处理它们,而v2却没有

我是用mod_重写的。Nathans以代码形式提出的建议:

RewriteEngine On 

# Convert ? -> %3F in queries and add .html to the end of the filename
RewriteCond %{ENV:REDIRECT_STATUS} !200 
RewriteCond %{QUERY_STRING} !^$ 
RewriteRule ^(.*)$ /$1\%3F%{QUERY_STRING}.html [L,NE]

# An addition for *.php files without question mark in its name, adding html to the end of the filename
RewriteRule ^(.*?)\.php$ $1.php.html

为了什么?您的文件系统中真的有一个名为foo.php?bar.html的文件吗?还是日志有问题?还有别的吗?是的,文件系统上有一系列文件名为foo.php?bar.html。它们是wget的-E标志的结果。