【问题标题】:.htaccess redirect attempt redirects wrong domain to wrong url.htaccess 重定向尝试将错误的域重定向到错误的 url
【发布时间】:2014-04-30 03:55:59
【问题描述】:

我以某种方式破坏了我的 .htaccess。我承认 .htaccess 不是我通常搞砸的东西,但我想如果我遵循其他示例,我会管理它。

最初我试图将www.shadowlordscomics.com 重定向到子文件夹中的新drupal 站点。但是我在漫画的末尾省略了 s,这破坏了 url。但是,它没有将www.shadowlordscomics.com 重定向到损坏的url,而是重定向了一个使用相同空间的不同域officialshadowlords.com

.htaccess 文件原本只有这个:

Options -Indexes

我用于重定向的内容是基于此:

Options -Indexes
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} !^www\.mysite\.com$ [NC]
RewriteRule .* http://www.mysite.com/   [L,R=301]
RewriteRule ^$ drupal/index.php [L]
RewriteCond %{DOCUMENT_ROOT}/drupal%{REQUEST_URI} -f
RewriteRule .* drupal/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* drupal/index.php?q=$0 [QSA]

有没有办法恢复重定向?让它停止重定向到损坏的网址? Officialshadowlords.com 意味着要转到其子文件夹中的 index.html 文件。

【问题讨论】:

    标签: php apache .htaccess redirect


    【解决方案1】:

    您可以使用 errordocument 重定向到主页
    错误文档 404 /

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-21
      • 2020-02-15
      相关资源
      最近更新 更多