dongli1887 2015-03-22 21:13
浏览 183
已采纳

CDN URL到根文件夹/防止重复内容?

For a image gallery I have to install a CDN Domain.

Default Domain:

http://www.example.com
Apache folder: /html/mywebsite

CDN Domain:

http://cdn.example.com
Apache folder: /html/mywebsite

The CDN Domain need the same Apache folder for url rewrite reasons etc.

Problem:

http://cdn.example.com
and
http://www.example.com

open the same website and this is bad. I cant rewrite (301) from cdn to www because I have to serve the images from the CDN. Also I cant use a 403:

RewriteCond %{HTTP_HOST} ^cdn\.example\.com$ [NC]
RewriteRule .* / [F]

because image urls from the cdn

http://cdn.example.com/images/test.jpg

get also a 403. Is it possible to make a 403 only for the root folder and not for subfolders or do you have a better idea?

btw. robots.txt is also bad, because images from the cdn should be indexed. A htaccess solution would be great.

  • 写回答

2条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 Python不使用Selenium怎么实现网页输入和点击
      • ¥50 vue百度地图导致浏览器崩溃
      • ¥15 请问这段C语言代码应该如何修改呢
      • ¥20 Latex 转入带数式的曲线图后数式部分报错
      • ¥15 Arcgis基于一幅栅格提取另一幅栅格单元值
      • ¥15 Verilog数据产生器代码疑点
      • ¥15 电脑部分网页无法访问是为什么?
      • ¥15 如何在vscode导出pdf失败了,拓展也安装了?
      • ¥15 使用python-kivy如何点击按钮选择手机相册中的图片?
      • ¥15 Matlab图像生成后如何对于打开exe文件