Forum Moderators: phranque
I need a little help.
I have a wordpress install that is using two particular pages to obtain credit card info and hence need to be https//
I've tried 301 redirects, rewrites, etc.. but they all end in loops.
I've tried this: (thinking I'm on the right track) but no luck.
RewriteRule "^/billpay/water-bill(/.*)" "https://%{HTTP_HOST}$1" [R=301,L]
I've also tried: redirect 301 /formpage/ [newdomain.com...]
But that results in a loop because the page is in effect redirecting itself.
I think the first example above is what I'm looking for, but I can't seem to get it to work.
Please help - I'm supposed to be going live and I can't until I get this working behind ssl.
Thanks for any help ya'll can give me!
# If not port 443 HTTPS
RewriteCond %{SERVER_PORT} !^443$
# Redirect payment page requests to HTTPS
RewriteRule ^/billpay/water-bill/(.*) https://%{HTTP_HOST}/billpay/water-bill/$1 [R=301,L]
Jim
In .htaccess the URL 'seen' by RewriteRule is "localized" to the current directory -- In other words, the path to "this .htaccess file's" directory is stripped from the URL 'seen' by RewriteRule in that .htaccess file.
So in httpd.conf, conf.d, etc., we'd write the code like this:
# If not port 443 HTTPS
RewriteCond %{SERVER_PORT} !^443$
# Redirect payment page requests to HTTPS
RewriteRule [b]^/b[/b]illpay/water-bill/(.*) https://%{HTTP_HOST}/billpay/water-bill/$1 [R=301,L]
# If not port 443 HTTPS
RewriteCond %{SERVER_PORT} !^443$
# Redirect payment page requests to HTTPS
RewriteRule [b]^b[/b]illpay/water-bill/(.*) https://%{HTTP_HOST}/billpay/water-bill/$1 [R=301,L]
because the directory path to this .htaccess file is "/", so that gets removed. Or in example.com/billpay/.htaccess it would be:
# If not port 443 HTTPS
RewriteCond %{SERVER_PORT} !^443$
# Redirect payment page requests to HTTPS
RewriteRule [b]^w[/b]ater-bill/(.*) https://%{HTTP_HOST}/billpay/water-bill/$1 [R=301,L]
Jim