Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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
Apache 重定向驻留的域_Apache_.htaccess_Url Rewriting - Fatal编程技术网

Apache 重定向驻留的域

Apache 重定向驻留的域,apache,.htaccess,url-rewriting,Apache,.htaccess,Url Rewriting,实际上我拥有三个域名,比如a.com、b.com和c.com 我为a.com买了一台主机,然后其他的都停了下来 这是我的真实面目 RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.b\.com RewriteRule (.*) http:// www..com/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^c\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.c\.com$ Rew

实际上我拥有三个域名,比如a.com、b.com和c.com 我为a.com买了一台主机,然后其他的都停了下来 这是我的真实面目

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.b\.com
RewriteRule (.*) http:// www..com/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^c\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.c\.com$
RewriteRule ^/?$ "http\:\/\/www\.c\.com\/history\/" [R=301,L]
如何在浏览器中不更改url的情况下,以独占方式将c.com重定向到“history”这样的子文件夹

谢谢

您可以使用此规则:

RewriteCond %{HTTP_HOST} ^(www\.)?c\.com$ [NC]
RewriteRule ^/?$ /history/ [L]
所以基本上只需从规则的目标中删除
http://
部分