Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Redirect 从子域上的目录重定向到根目录_Redirect - Fatal编程技术网

Redirect 从子域上的目录重定向到根目录

Redirect 从子域上的目录重定向到根目录,redirect,Redirect,谷歌已经为subdomain.thedomain.com/directory编制了索引 我想把它重定向到域名 .htaccess文件中有什么内容?除了这个,我找到了所有其他的组合 请帮忙 提前感谢,非常感谢您没有找到正确的文档。请阅读以下内容: 更新: 首先,将其写入目录/.htaccess: RewriteEngine on RewriteRule .* http://thedomain.com/ [R,L,NE] *表示任何内容,由于规则来自.htaccess文件,因此实际上表示此目录中

谷歌已经为subdomain.thedomain.com/directory编制了索引

我想把它重定向到域名

.htaccess文件中有什么内容?除了这个,我找到了所有其他的组合

请帮忙


提前感谢,非常感谢您没有找到正确的文档。请阅读以下内容:

更新:

首先,将其写入
目录/.htaccess

RewriteEngine on
RewriteRule .* http://thedomain.com/ [R,L,NE]
*
表示任何内容,由于规则来自
.htaccess
文件,因此实际上表示此目录中的任何内容


总的来说,这意味着:使用括号中的选项将该目录中的任何内容重定向到主页(这只会起作用)。

这并没有告诉我如何重定向到根目录。。。至少我不认为——这太难理解了,这就是我来这里的原因。有人能帮我吗?你想重定向
http://subdomain.thedomain.com/directory/*
到主页
http://thedomain.com/
,不管
*
是什么?然后在文档中的示例中省略
$1
。或者,如果你的意思是别的,在你的问题中提供更多的例子。是的,没错<代码>http://subdomain.thedomain.com/directory/重定向到
http://thedomain.com
。不管*是什么,因为谷歌上只有一个页面可以重定向。我用哪一个例子?很抱歉,我是一个完全的新手,我甚至不知道从哪里开始。你能帮我把它打出来吗?这会把我从
subdomain.domain.com/目录带到
domain.com
<代码>#使用RewriteRule^/docs/(.+)上的mod_rewrite RewriteEnginehttp://new.example.com/docs/$1[R,L]
还是需要我去
domain.com/docs
重写规则上的重写引擎。*http://thedomain.com/ [R,L,NE]
使站点无法启动。我只需要这一页
http://info.westmountgrand.com/welcome
重定向到
http://westmountgrand.com
希望这更清楚