我想重定向到www.example.com/ext_jobs/
www.example.com/customer/tremoria/ext_jobs/
我的.htaccess代码有什么问题?
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^/ext_jobs/(.*)$ customer/tremoria/ext_jobs/$1 [L]
但我的解决办法是行不通的。怎么了?
我想重定向到www.example.com/ext_jobs/
www.example.com/customer/tremoria/ext_jobs/
我的.htaccess代码有什么问题?
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^/ext_jobs/(.*)$ customer/tremoria/ext_jobs/$1 [L]
但我的解决办法是行不通的。怎么了?
您可以使用rewritebase不是/在^/ext_jobs/(.*)$
Options +FollowSymLinks
RewriteEngine on
RewriteBase/
RewriteCond %{REQUEST_URI} !^customer/tremoria/ext_jobs
RewriteRule ^ext_jobs/(.*)/?$ customer/tremoria/ext_jobs/$1 [L,NC,QSA]
不要使用MOD-改写为简单的事情。你有简单的解决方案,如重定向,RedirectMatch和别名等mod-alias。 在你的情况下,如果你真的需要重定向,我会尝试重定向。但在你的示例中,你只是在做内部重定向,对用户浏览器透明。
所以别名也许是解决
Alias ext_jobs/ customer/tremoria/ext_jobs/
请不要签收您的帖子。 – 2012-01-11 11:57:10