【发布时间】:2013-07-18 15:12:39
【问题描述】:
在我的网站 mycreditstatus.co.za 中,我使用 .htaccess 重写 URL 并将其从 http 重定向到 https,这是我在 public_html (http) 目录中用于 .htaccess 的代码:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
它工作得很好,但它会将所有 http url 重写并重定向到 https。
问题是我的网站也会对非 https 网站执行一些请求,所以我不想重写并将某些链接重定向到 https。
这是我不想重定向/重写的链接之一:
我想知道我应该为 public_ssl (https) 目录上的 .htaccess 编写的代码,因为请求将来自那里。
【问题讨论】:
-
您可以在
RewriteCond下使用排除项 -
我不知道如何排除网址。使用 modRewrite 对我来说很新鲜。对不起。
标签: php regex .htaccess rewrite url-redirection