简体   繁体   中英

Using htaccess deny causes error with PHP getimagesize

I have the following in my htaccess file to prevent access to a website outside of our network:

<Limit GET POST PUT>
 order deny,allow
 deny from all
 allow from xx.xxx.xxx.xx
</Limit>

But this causes the following error:

Warning: getimagesize(http://domain.com/wp-content/uploads/2014/07/nalogo.png) [function.getimagesize]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /html/wp-content/themes/test/framework/styles.php on line 60

Any ideas on how I can fix this? This works if I disable that htaccess deny.

Try adding localhost in the allow list:

<Limit GET POST PUT>
 order deny,allow
 deny from all
 allow from xx.xxx.xxx.xx
 allow from 127.0.0.1
</Limit>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM