【问题标题】:bluehost shared ssl redirect with htaccessbluehost 与 htaccess 共享 ssl 重定向
【发布时间】:2014-04-17 22:50:24
【问题描述】:

我想向我的 bluehost 共享 ssl 页面添加重定向: https://secure.bluehost.com/~user/page_to_redirect

到这里: http://mydomain.com/folder/new_page

我需要这个设置,因为我使用的是网站的 API,它要求回调 url 是 ssl。我需要将其重定向到我的 ruby​​ on rails 应用程序。

我已经像这样配置了我的 .htacccess (root):

    Options -Indexes
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www\.mydomain.\.com$
    RewriteRule ^/?$ "http\:\/\/mydomain\.com\/" [R=301,L]

    Redirect /page_to_redirect http://mydomain.com/folder/new_page

重定向适用于非 ssl 页面: mydomain.com/page_to_redirect 但不是 ssl 页面: https://secure.bluehost.com/~user/page_to_redirect

我刚刚收到 404 错误。

有人有这方面的经验吗? Bluehost 支持根本不是很有帮助。

这是有效的:

    Options -Indexes
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www\.mydomain.\.com$
    RewriteRule ^/?$ "http\:\/\/mydomain\.com\/" [R=301,L]

    Redirect 301 /~mydomain/page_to_redirect http://mydomain.com/folder/new_page

【问题讨论】:

  • 放弃 bluehost,他们很烂。
  • 这对我有用,在我的 htaccess 文件中:>>>>> Redirect 301 /~mydomain/page_to_redirect mydomain.com/folder/new_page
  • 随时提交作为答案并接受它。

标签: ruby-on-rails .htaccess ssl bluehost


【解决方案1】:

这是有效的:

Options -Indexes
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.mydomain.\.com$
RewriteRule ^/?$ "http\:\/\/mydomain\.com\/" [R=301,L]

Redirect 301 /~mydomain/page_to_redirect http://mydomain.com/folder/new_page

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-28
    • 2016-12-20
    • 1970-01-01
    • 2012-02-06
    • 1970-01-01
    • 1970-01-01
    • 2014-11-24
    • 2014-07-19
    相关资源
    最近更新 更多