Forum Moderators: phranque

Message Too Old, No Replies

Rewritecond to https

         

jarea

2:24 am on Jan 3, 2008 (gmt 0)

10+ Year Member



I have been trying to get a rewrite working with no success. I am looking for any QUERY_STRING that ends with 'donate-wnf' (in either upper or lower case) where HTTPS is not activated. When found I want to rewrite to https and omit the www. portion of the server name

This is the code I have been using (along with a bunch of variations) with no success. I am a dullard about pcre and htaccess and can use any help you can provide. Thanks in advance.


RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS}!=on
RewriteCond %{QUERY_STRING} /donate\-wnf$/i
RewriteRule https://website.org/wnf/?q=node/add/donate-wnf [R,L]

jdMorgan

2:33 am on Jan 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




RewriteEngine on
RewriteCond %{HTTPS} !^on$
RewriteCond %{QUERY_STRING} donate-wnf$ [NC]
RewriteRule .* https://website.org/wnf/?q=node/add/donate-wnf [R=301,L]

The %{HTTPS} variable is not an Apache core variable, and is sometimes undefined. An alternative approach that uses an Apache-native variable is:

RewriteCond %{SERVER_PORT} !^443$

Jim

jarea

4:24 pm on Jan 3, 2008 (gmt 0)

10+ Year Member



Jim - Perfect

Thank you so much.

jarea