Welcome Guest, Not a member yet? Register   Sign In
Forcing a redirect from HTTPS to HTTP for one controller
#1

I've implemented my CodeIgniter 2.x site on a server with SSL and have included a .htaccess file with all the relevant redirects to force HTTPS. However, I need one part of my site to remain HTTP and I'm struggling with this because of the way CodeIgniter processes requests through the index.php file. I want to keep mydomain.com/cron as HTTP and cron is of course a controller processed in the same way as all other controllers. So far, my .htaccess file looks like this:-

Code:
#secure htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>

RewriteEngine On

RewriteCond %{HTTPS} off
RewriteRule ^(?!cron)(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

RewriteEngine On
#Remove index.php being displayed on pages
RewriteCond $1 !^(index\.php|images|attachments|email|css|js|robots\.txt)
RewriteRule ^/?(.*)$ /index.php?/$1 [L]

But I think this is wrong because there is no physical cron folder in the server directory which I think is where the confusion is. Does anyone know a simple fix on how to redirect just the one controller to force HTTP rather than HTTPS?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB