doupin5408 2018-10-19 22:08
浏览 118

通过在浏览器中打开文件链接,仅从URL访问文件,而不是直接访问文件

I have 2 hostings in one account with GoDaddy.

One hosting I use for my Wordpress website, and second hosting I use to keep my files related to website, to increase speed or performance.

But for the files in second account, I want to access only if request came from my first hosting or the website.

I searched couple of websites, and they suggested me that by using htaccess I can make it happen. But unfortunately none of them working. Some examples I am mentioning below.

RewriteEngine on
RewriteCond %{HTTP_REFERER}!^https://thefreetools.com [NC]
RewriteCond %{HTTP_REFERER}!^http://www.thefreetools.com [NC]
RewriteRule .*\.(jpg¦zip¦js¦txt)$ - [F,NC]


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^https://(www\.)?thefreetools[NC] 
RewriteCond %{HTTP_REFERER} !^https://(www\.)?thefreetools.*$ [NC] 
RewriteRule \.(gif|zip|png|js|css|bmp|exe|rar)$ https://thefreetools.com[R,L]

Or can I make it happen by manuplating DNS records of my GoDaddy Hosting.

PLEASE NOTE :- I AM USING SSL ON MY WEBSITE, SO URL STARTS WITH HTTPS

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥50 mac mini外接显示器 画质字体模糊
    • ¥15 TLS1.2协议通信解密
    • ¥40 图书信息管理系统程序编写
    • ¥20 Qcustomplot缩小曲线形状问题
    • ¥15 企业资源规划ERP沙盘模拟
    • ¥15 树莓派控制机械臂传输命令报错,显示摄像头不存在
    • ¥15 前端echarts坐标轴问题
    • ¥15 ad5933的I2C
    • ¥15 请问RTX4060的笔记本电脑可以训练yolov5模型吗?
    • ¥15 数学建模求思路及代码