301 htaccess dir重定向到不同的子域

时间:2015-01-20 16:22:04

标签: .htaccess rewrite

我会重定向整个目录" https://sub.domain.ext/dir1"到另一台机器上的另一个位置" https://sub1.domain.ext/dir1",我在/.htaccess中使用以下规则但没有成功: 该页面根本没有重定向。

Rewriterule ^dir1/(.*) https://sub1.domain.ext/dir1/$1 [R=301,L]

# this is the whole ht access
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^Morfeus
RewriteRule ^.*$ - [F]
</IfModule>
# supress php errors     
php_value display_errors off

# force https 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://sub.domain.ext/$1 [R,L]

任何提示?

场景:ubuntu + apache

其他htaccess规则偏差

THX

1 个答案:

答案 0 :(得分:0)

删除dir1 /中的htaccess文件,问题解决了。