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.

  • 写回答

1条回答 默认 最新

  • 普通网友 2014-04-30 04:05
    关注

    you can redirect to home page using errordocument
    ERRORDOCUMENT 404 /

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 关于用python写支付宝扫码付异步通知收不到的问题
  • ¥50 vue组件中无法正确接收并处理axios请求
  • ¥15 隐藏系统界面pdf的打印、下载按钮
  • ¥15 MATLAB联合adams仿真卡死如何解决(代码模型无问题)
  • ¥15 基于pso参数优化的LightGBM分类模型
  • ¥15 安装Paddleocr时报错无法解决
  • ¥15 python中transformers可以正常下载,但是没有办法使用pipeline
  • ¥50 分布式追踪trace异常问题
  • ¥15 人在外地出差,速帮一点点
  • ¥15 如何使用canvas在图片上进行如下的标注,以下代码不起作用,如何修改