2014-11-21 10 views

回答

0

你可以在你的根的.htaccess使用這樣的規則:

Options +FollowSymLinks 
RewriteEngine On 

RewriteCond %{HTTP_HOST} ^(www\.)?sub\.example\.com$ [NC] 
RewriteRule ^old/id/(.+)$ /new/%1 [R=302,NC] 
0

嘗試:

RewriteRule ^/old/id/(.*)$ http://sub.example.com/new/$1 [R=302,NC] 

請確保您已經mod_rewrite允許的。

+0

不工作。 mod_rewrite是允許的。 – 2014-11-21 14:47:54