dongxian6285
2014-04-30 03:55
浏览 33
已采纳

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

I went and broke my .htaccess somehow. I admit that .htaccess is not something I usually mess around with, but I thought if I followed other examples, I'd manage it.

Originally I was trying to redirect www.shadowlordscomics.com to a new drupal site in a subfolder. But I left off the s at the end of comics, which broke the url. However, instead of redirecting www.shadowlordscomics.com to the broken url, it redirected a different domain that uses the same space, officialshadowlords.com.

The .htaccess file originally only had this inside of it:

Options -Indexes

What I used for my redirect was based off of this:

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]

Is there a way to revert the redirect? To make it stop redirecting to the broken url? Officialshadowlords.com is meant to be going to an index.html file in its sub-folder.

图片转代码服务由CSDN问答提供 功能建议

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

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

.htaccess文件原本只有这个内部 :

 选项-Indexes 
   
 
 

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

 选项-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条回答 默认 最新

  • dqkgxq0561 2014-04-30 04:05
    已采纳

    you can redirect to home page using errordocument
    ERRORDOCUMENT 404 /

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题