问题描述
我正在尝试向使用 AWS Amplify 的 Google 提交站点地图。站点地图采用 XML 格式,位于我站点的根文件夹中。当我在 Google Search Console 中提交站点地图时,我收到 403 禁止错误。
我的站点根文件夹中有一个 .htaccess 文件,它可能与问题有关。我担心对 .htaccess 进行更改并弄乱我设置的规则。
这是我的 htaccess 文件:
Header set Strict-Transport-Security "max-age=31536000" env=HTTPS
# deny access to .htaccess
<Files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</Files>
# prevent website directory listing
Options -Indexes
# disable image hotlinking
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mattdailey.net [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ https://www.example.com/assets/images/hotlinking.png [R,L]
我不确定是否需要 AWS Amplify 上的 .htaccess 文件。我在 Amplify 文档中找不到任何提及 .htaccess 的内容。
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com</loc>
<lastmod>2021-02-10</lastmod>
<changefreq>monthly</changefreq>
</url>
</urlset>
我是否需要修改我的 .htaccess 文件,或者我需要更改 AWS 中的某个设置?我最近将我的网站移到了 Amplify,但我对它还是陌生的。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)