.htaccess:如果是路径,什么也不做,否则,做重写

时间:2010-10-29 12:24:41

标签: .htaccess mod-rewrite

这次我觉得这个问题非常简单...... 我如何写我的htaccess来做这个指示:

如果“/上传”路径进入我的请求,而不是全部重定,只需要定期请求 ELSE DO THE REWRITERULE:RewriteRule(。*)http://theDestinationDomain.com/ $ 1 [P,L]

我测试过:

RewriteEngine on
RewriteCond %{REQUST_URI} !^/uploads/(.*)
RewriteCond %{HTTP_HOST} theDomainThatWillBeRedirect.com
RewriteRule (.*) http://theDestinationDomain.com/$1 [P,L]

那只是不工作......这总是重定向到目标Domaine.com /...

有什么想法吗?

非常感谢!

见到你

奥利弗

1 个答案:

答案 0 :(得分:3)

注意额外的E.:)

RewriteCond %{REQUEST_URI} !/uploads/
RewriteCond %{HTTP_HOST} theDomainThatWillBeRedirect.com
RewriteRule (.*) http://theDestinationDomain.com/$1 [L,R=301]