site 子目录充当根目录?我应该重定向 301 永久吗?

发布于 2024-10-07 13:16:35 字数 250 浏览 0 评论 0原文

我遇到以下问题 - 我的网站位于我的托管帐户上 /www 文件夹下的一个文件夹,假设它是 /www/shop。然后,所有访问主域的访问者都会被 /www 文件夹中的 .htaccess 文件重定向到子文件夹。

我是否应该将此重定向 301 设置为永久,以便搜索引擎可以更好地索引我的网站? 这是我用于此目的的简单 .htaccess:

RewriteEngine On
RewriteRule ^$ /shop [L]

I have the following problem - my site is located one folder below the /www folder on my hosting account, let's say its /www/shop. All the visitors that come to the main domain are then redirected by .htaccess file in the /www folder which takes them to the subfolder.

Should I make this redirect 301 Permanent, so that search engines could index my site better?
Here's the simple .htaccess that I use for the purpose:

RewriteEngine On
RewriteRule ^$ /shop [L]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

世界和平 2024-10-14 13:16:35

只要它确实是永久的,就可以。

As long as it's really permanent, yes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文