对子域的所有子目录使用.htaccess RewriteCond

时间:2012-10-08 23:38:00

标签: apache .htaccess mod-rewrite rewrite subdomain

如何为子域的所有子目录使用RewriteCond

示例:test.example.com/folder1/page1.php - > code.example/folder1/page1.php(在地址栏中显示test.example.com/folder1/page1.php)

我目前正在使用:

RewriteCond %{HTTP_HOST} ^(.+)\.example\.com
RewriteRule ^(.*)$ http://code.example.com/$1 [CO=cookie:%1:.example.com:126144000:/,P]

这就是我想要的test.example.com/page2.php - > code.example.com/page2.php(在地址栏中显示test.example.com/page2.php)
但当我做test.example.com/folder1/page1.php - > code.example.com/folder1/page1.php我看到code.example.com/folder1/page1.php(我做想要)

0 个答案:

没有答案