.htaccess重定向尝试将错误的域重定向到错误的URL

时间:2014-04-30 03:56:00

标签: php apache .htaccess redirect

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

最初我试图将www.shadowlordscomics.com重定向到子文件夹中的新drupal站点。但是我在漫画结束时离开了s,这打破了网址。但是,它不是将www.shadowlordscomics.com重定向到已损坏的网址,而是重定向使用相同空格的其他网域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 文件。

1 个答案:

答案 0 :(得分:1)

您可以使用errordocument重定向到主页 ERRORDOCUMENT 404 /

相关问题