Image .htaccess阻止某些内部页面上的图像

Image .htaccess阻止某些内部页面上的图像,image,http-status-code-403,Image,Http Status Code 403,我正在为一个朋友做一些网页设计,我注意到除了我正在工作的子目录之外,她网站上其他地方的图片都可以正常加载。我查看了她的.htaccess文件,确信它设置为阻止人们窃取她的图像。很公平,除了我正在处理的页面在她的域中,但我仍然得到403错误。我正在粘贴下面的.htaccess内容,但我用xyz、123和abc替换了域名 因此,特别是我在xyz.com/DesignGallery.asp上的页面从xyz.com/machform/data/form_1/文件中提取图像,并导致禁止的错误 Rewrit

我正在为一个朋友做一些网页设计,我注意到除了我正在工作的子目录之外,她网站上其他地方的图片都可以正常加载。我查看了她的.htaccess文件,确信它设置为阻止人们窃取她的图像。很公平,除了我正在处理的页面在她的域中,但我仍然得到403错误。我正在粘贴下面的.htaccess内容,但我用xyz、123和abc替换了域名

因此,特别是我在xyz.com/DesignGallery.asp上的页面从xyz.com/machform/data/form_1/文件中提取图像,并导致禁止的错误

RewriteEngine on
<Files 403.shtml>
order allow,deny
allow from all
</Files>
RewriteCond %{HTTP_REFERER} !^http://xyz.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://xyz.com/machform/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://xyz.com/machform/data/form_1/files/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://xyz.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://abc.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://abc.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://abc.xyz.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://abc.xyz.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://123.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://123.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://123.xyz.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://123.xyz.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.xyz.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.xyz.com/machform/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.xyz.com/machform/$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.xyz.com/machform/data/form_1/files/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.xyz.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.abc.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.abc.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.abc.xyz.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.abc.xyz.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.123.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.123.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.123.xyz.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.123.xyz.com$      [NC]

RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
deny from 69.49.149.17
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^vendors\.html$ "http\:\/\/www\.xyz\.com\/Design_Gallery_1\.htm" [R=301,L]

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^vendors\.asp$ "http\:\/\/www\.xyz\.com\/Design_Gallery_1\.htm" [R=301,L]

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^ArtGraphics\.html$ "http\:\/\/www\.xyz\.com\/Art_Gallery_1\.htm" [R=301,L]

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^ArtGraphics\.asp$ "http\:\/\/www\.xyz\.com\/Art_Gallery_1\.htm" [R=301,L]

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^Gear\.asp$ "http\:\/\/www\.xyz\.com\/Gear_Gallery_1\.htm" [R=301,L]

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^Gear\.html$ "http\:\/\/www\.xyz\.com\/Gear_Gallery_1\.htm" [R=301,L]

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^NewsletterSign\-Up\.html$ "http\:\/\/www\.xyz\.com\/Newsletter\.htm" [R=301,L]

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^NewsletterSign\-Up\.asp$ "http\:\/\/www\.xyz\.com\/Newsletter\.htm" [R=301,L]

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^KidzStuff\.html$ "http\:\/\/www\.xyz\.com\/KidzStuff1\.htm" [R=301,L]

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^KidzStuff\.asp$ "http\:\/\/www\.xyz\.com\/KidzStuff1\.htm" [R=301,L]

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^Vendors\.html$ "http\:\/\/www\.xyz\.com\/Design_Gallery_1\.htm" [R=301,L]

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^Vendors\.asp$ "http\:\/\/www\.xyz\.com\/Design_Gallery_1\.htm" [R=301,L]

我敢打赌,其中一条指令中存在语法错误,您在替换www.xyz.com时可能已经更正了该错误

如果您有权访问httpd.conf,那么可以设置RewriteLog和RewriteLogLevel指令,以了解在尝试加载映像时发生了什么。你应该能够很容易地识别出冒犯的界线。确保完成后删除这些指令

如果您没有访问httpd.conf的权限,可以逐个删除这些行,直到找到违规者


一旦这些都完成了,您就可以大大简化.htaccess文件。大多数重写条件都是多余的。很容易出现微小错误而不被注意

问题是,这个.htaccess文件中有什么错误阻止我从/machform/data/form_1/files目录读取图像?