修正してお知らせください。私の問題は、.htaccess ホットリンク保護が機能しないことです。.htaccess をサポートする共有サーバーを使用しています。(SEO フレンドリーなリンクが機能します)
私のドメイン タイプは、http://www.mydomain.p.ht
またはhttp://mydomain.p.ht
私のトライアルの 2 つのソースは次のとおりです。
- http://www.htaccesstools.com/hotlink-protection/
- スタックオーバーフロー
mydomain
本当のドメインに置き換えることを忘れていませんでした
私の.htaccess
RewriteEngine On
RewriteBase /
# hotlink protection
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydomain.p.ht [NC]
RewriteRule \.(jpg|jpeg|png|gif|css)$ - [NC,F,L]
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
# File caching is another famous approach in optimizing website loading time
<FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|js|css|pdf)$">
Header set Cache-Control "max-age=2592000"
</FilesMatch>
#SEO friendly linking
...
...
私も試しました
1
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydomain.p.ht [NC]
RewriteRule \.(flv)$ - [NC,F,L]
2
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydomain\.p\.ht/.*$ [NC]
RewriteRule .*\.(jpg|jpeg|png|gif)$ - [F,NC,L]