Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using .htaccess to control http and https

Status
Not open for further replies.

RWunder

Programmer
Oct 30, 2001
4
US
I need to have 2 pages on a wordpress website uses http and the rest of the website use https.

The current .htaccess file is currently working just fine in making sure the site is under https.

I have not been able to get it to allow the 2 pages that need to stay http. These 2 pages have an iframe that display content from other websites that do not have SSL certificates, otherwise everything is just fine.

The problem is The page isn't redirecting properly
It is stuck in a redirect loop between http and https.

You can find the pages in question here: use this for username: test@test.com
and the password: test

The pages that need to be http are: Test Your Knowledge and Incorporate.

The current .httaccess is :
Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} =off
RewriteCond %{REQUEST_URI} !=^(/businc-test-knowledge|/businc-incorporate)$ [NC]
RewriteRule (.*) [URL unfurl="true"]https://%{HTTP_HOST}%{REQUEST_URI}[/URL] [L]

RewriteCond %{HTTPS} =on
RewriteCond %{REQUEST_URI} ^(/businc-test-knowledge|/businc-incorporate)$ [NC]
RewriteRule (.*) [URL unfurl="true"]http://%{HTTP_HOST}%{REQUEST_URI}[/URL] [L,R=301]

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>

# END WordPress

Am what I am asking not possible in .htaccess?
I have been able to get it to switch to http, but when it works it remains in http on all pages from that point on and does not switch back to https on all other pages.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top