Wordpress Apache重写规则包括字符串后面的任何内容

Wordpress Apache重写规则包括字符串后面的任何内容,wordpress,apache,.htaccess,mod-rewrite,Wordpress,Apache,.htaccess,Mod Rewrite,我在我的网站的root.htaccess中有一个重写规则,它假设阻止人们从我的网站下载zip文件,除非他们在上面。事情是这样的: RewriteCond %{HTTP_REFERER} !^http://(www.)?example.com/ [NC] RewriteCond %{HTTP_HOST} !^\.example\.com$ [NC] RewriteCond %{REQUEST_URI} \.(doc|zip|pdf)$ [NC] RewriteRule .*.(doc|zip|pd

我在我的网站的root.htaccess中有一个重写规则,它假设阻止人们从我的网站下载zip文件,除非他们在上面。事情是这样的:

RewriteCond %{HTTP_REFERER} !^http://(www.)?example.com/ [NC]
RewriteCond %{HTTP_HOST} !^\.example\.com$ [NC]
RewriteCond %{REQUEST_URI} \.(doc|zip|pdf)$ [NC]
RewriteRule .*.(doc|zip|pdf)$ http://example.com/ [nc] 
问题是,当您键入包含zip文件的url,然后在下面的示例之后添加任何字符时,它会将您发送到webhost 404页面,而不是我自己的Wordpress 404/example.com

http://example.com/some.zip/
http://example.com/some.zip/123
http://example.com/some.zip/asd
有人能告诉我如何更改吗?

不要在.zip之后使用$anchor


谢谢这是完美的,我想我可以在这里简单地问一下,而不是几个小时的谷歌搜索和尝试这么多不同的东西,嘘。。
RewriteCond %{HTTP_REFERER} !^http://(www.)?example.com/ [NC]
RewriteCond %{HTTP_HOST} !^\.example\.com$ [NC]
RewriteRule \.(doc|zip|pdf)(/|$) http://example.com/ [L,NC,R]