Welcome Guest, Not a member yet? Register   Sign In
Making all pages load https and force ONE Unspecific page to always load/redirect http
#1

[eluser]silentkillerjoe[/eluser]
Ok so in /etc/apache2/sites-available I edited a file called default, so now any url you type to go to my website automatically redirects to the same url using https. I want that to continue happening except for on one page I want it to always load http, first of all I dont know how and second the page is random like mycompany.com/cks.php?RANDOM-LETTERS-NUMBERS-CHARACTERS ... So somehow mycompany.com/cks.php? with anything after that too needs to load http

I dont have or know what CodeIgniter is.
I use putty-ssh and filezilla-sftp
Running apache 2xxx php5 and ubuntu hardy
#2

[eluser]Pascal Kriete[/eluser]
Quote:I dont have or know what CodeIgniter is.
Hate to be rude, but why post this question here then?

Also, you're being very unspecific about what you changed - it makes replication very difficult (searching for 'apache default file' is useless - for obvious reasons).

For apache to run both encrypted and non-encrypted versions it needs to bind to both ports (443 and 80 respectively). Most of the time you'll do that using virtual hosts. Once that is set up you can force your (ugly) url to use port 80 with a rewrite rule such as this:
Code:
RewriteRule "^/cks\.php[?](.*)" "http://%{HTTP_HOST}$1" [R=301,L]

Hope that helped a little bit.
Apache has a mailing list, and there are plenty of apache related forums out there. Those can probably cater to your specific needs better than I can.

Welcome to the CodeIgniter forums.
#3

[eluser]silentkillerjoe[/eluser]
Well this is the code I added originally to make every page load https..

I added everything below the line

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
--------------------------------------------------------------------
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
</Directory>


So can I just add the code you gave me to that? Or does that need to be edited?
#4

[eluser]Pascal Kriete[/eluser]
Should work as is - hopefully it won't fall into an infinite loop:
Code:
RewriteEngine on
Options +FollowSymLinks
RewriteRule "^/cks\.php[?](.*)" "http://%{HTTP_HOST}$1" [R=301,L]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

Basically, it's a regular expression that says if the request starts with "/cks.php?", serve the http version.
Not sure on the [?], might have to use \? instead.

EDIT: This might be more appropriate to mitigate infinite-recursion:
Code:
RewriteRule ^(?!/chks\.php[?]).*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
#5

[eluser]silentkillerjoe[/eluser]
Tried didnt work, then tried with the \? instead and it still didnt work. Hmm.. Here is an example of one of the urls.

mycompany.com/cks.php?k=59076768A4ABE68D00CC727230985D48&cdk=true

Thanks for your help btw. I only posted in this forum because I followed a link on google and saw a similar post about loading a certain page in https and it seemed like using CodeIgniter was in part of the steps.. Ill look for the post again

EDIT: Btw, if you help me get this done. I will pay you via paypal or alertpay.
#6

[eluser]silentkillerjoe[/eluser]
Just doesnt seem to work. Anyway I no longer need this done.. Thanks for trying Smile




Theme © iAndrew 2016 - Forum software by © MyBB