.htaccess, regular expresions, redirects

0 replies
I'm familiar with mod_rewrite and .htaccess, I have almost zero experience writing rules so hopefully someone here can point me in the right direction.

I have a wordpress powered site with an online employee application form that needs to be secured. I've taken care of the SSL side of things thru Godaddy.

Now I need to redirect all https requests back to http EXCEPT for the one page that has the employee application form.

Below is what I've tried:

Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

# Disable SSL on pages other than application
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^/application/$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]


# Require SSL on payments.php
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} ^/application/$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
Using the above code, the homepage is redirected from "https://www.mysite.com" to "http://www.mysite.com. [Good] The employee application page redirects to https://www.mysite.com/application/ [Also Good].

Problem is that all internal pages are unaffected by the redirect leaving both the https and http versions available. What I need is for every page on the site except for the employee application page to redirect to http.

Any help would be appreciated.

Thanks!
#expresions #htaccess #redirects #regular

Trending Topics