【发布时间】:2015-12-04 04:30:21
【问题描述】:
我正在使用 .htaccess 将所有查询重定向到 https://www。例子.com
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.example.com%{REQUEST_URI} [L,R=301]
#and below some rules from symfony2 configuration
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]
RewriteRule .? %{ENV:BASE}/app.php [L]
现在我想排除一些 url:http://example.com/someurl (不要将此 url 重定向到 https 方案,也不要添加 www)我怎样才能得到这个?
我在 stackoverflow 中寻找答案,但在重定向到 https 时仅找到一条规则的解决方案...
【问题讨论】:
-
在这里看看 RewriteRule httpd.apache.org/docs/current/rewrite/flags.html 的 S 标志
标签: .htaccess symfony mod-rewrite web https