-1

我们的一项业务关闭,我们希望根据 SEO 的相关内容将页面从旧网站重定向到我们的新网站。

我们的网站使用 GoDaddy 上的 Wordpress 托管主机托管。GoDaddy 告诉我,他们不允许任何人编辑托管 Wordpress htaccess 文件,而是我应该使用 Filezilla。

我能够访问旧站点的 .htaccess 文件并为其创建 301 重定向。我对原始文件进行了备份并将其保留在服务器上并上传了新的 .htaccess,但是当我上传新文件时出现 500 内部服务器错误。有人注意到我的流程或代码有什么问题吗?

我使用了 301 代码计算器来确保我的代码正确 我确保文件类型正确(在记事本中创建,保存为所有文件 - UTF-8) 我无法访问 GoDaddy 上的 cpanel - 我必须为此使用外部服务器访问因为它们不支持托管 Wordpress 托管编辑。我确保该文件名为 .htaccess 我已确保重命名我的备份,以免干扰。我在我的 URL 中添加了 https:// 而不是 http://,因为有人告诉我这可能会影响问题。我尝试将旧站点的整个 URL 放入代码中,而不仅仅是附件(即https://theglenwoodvenue.com/celebrations/而不是 /celebrations)。

# BEGIN GD-SSL
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_USER_AGENT} ^(.+)$
RewriteCond %{SERVER_NAME} ^theglenwoodvenue\.com$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Header add Strict-Transport-Security "max-age=300"
</IfModule>
# END GD-SSL


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Redirect 301 /celebrations/ https://irregardlesscatering.com/glenwood- 
closing-message-homepage/

该页面应该重定向到一个新域(从https://theglenwoodvenue.com/celebrations/http://irregardlesscatering.com/glenwood-closing-message-homepage/)——这个 301 重定向只是我正在测试的一个,还会有更多,但我什至无法让这个工作。

4

1 回答 1

0

如果您不知道 htaccess 301 重定向,那么您可以在 wordpress 中使用简单的这个插件,它很容易使用,您也可以直接从您的 wordpress 插件安装这个插件添加新插件选项,插件名称是 Redirection

https://wordpress.org/plugins/redirection/

于 2019-01-17T05:34:55.040 回答