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 /

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

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算