1
網址:的.htaccess重定向根/老/可變根/新/ same_variable
www.sub.example.com/old/id/345 (345 is post id)
所需的URL:
www.sub.example.com/new/345
試過,但不起作用:
謝謝!
網址:的.htaccess重定向根/老/可變根/新/ same_variable
www.sub.example.com/old/id/345 (345 is post id)
所需的URL:
www.sub.example.com/new/345
試過,但不起作用:
謝謝!
你可以在你的根的.htaccess使用這樣的規則:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?sub\.example\.com$ [NC]
RewriteRule ^old/id/(.+)$ /new/%1 [R=302,NC]
嘗試:
RewriteRule ^/old/id/(.*)$ http://sub.example.com/new/$1 [R=302,NC]
請確保您已經mod_rewrite
允許的。
不工作。 mod_rewrite是允許的。 – 2014-11-21 14:47:54