Portal Home > Knowledgebase > Articles Database > Full website https but 1 url http - How?


Full website https but 1 url http - How?




Posted by bambinou, 09-02-2015, 06:48 AM
Hello, I am having a real problem, my whole website has a log in in the navbar therefore https is super important to have on the whole website, but, for my printers to download the orders via 2g, the url of that specific folder has to be http. How to get get a full website https but remove https from one single folder please? Thank you, Ben

Posted by Srv24x7, 09-02-2015, 08:24 AM
Hi, You said something about printer, may I know what exactly you intend to do, so I can check and advise...

Posted by Katamaze, 09-02-2015, 08:36 AM
I agree with Srv24x7 anyway a simple htaccess rule should be enough unless you have a certain environment.

Posted by bambinou, 09-02-2015, 12:04 PM
Thank you both for your reply. @Srv24x7, I have purchase GPRS printers which are working on 2G, they do not have fixed ips. When an order is processed, my script creates a txt file of the order, the printer every 10 seconds tried to download that same txt file and see if there are any new orders vs the last download. If a new order is found, the printer prints it and sends a callback... My problem is that those printers can only download the txt file from a non https url which is a bit of a pain when you have a full site using https. @Katamaze If I understand, I have to add this htaccess condition inside the folder where I would like the directory to "not be" called as https but leave my htaccess with the https in the root of the website, am I correct? Thank you to both of you. Ben

Posted by bambinou, 09-02-2015, 03:09 PM
Ok so the htaccess code you gave me did not work unfortunately. I will explain the problem better. Currently I have this in my root htaccess: So As you can see I am forcing the urls in the website to go https due to a log in the navbar which is all over the site. Now after that code I tried to add this but it creates a redirect loop..... All I want is the whole website to be https but not the url: http://mysite.com/printing/ And I am not sure it is actually possible.... If you have another idea please let me know. Thank you. Ben

Posted by lynxkript, 09-02-2015, 03:29 PM
Put following code in an htaccess file under the directory /printing/ and check if that works RewriteEngine Off

Posted by Srv24x7, 09-03-2015, 09:36 AM
Hi, Can you give the below code a try in the .htaccess file. #--- Turn off the SSL for /printing ---# RewriteCond %{HTTPS} on RewriteCond %{REQUEST_URI} ^/printing RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L] #--- Turn on the SSL for all except /printing ---# RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} !^/printing RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
MSSQL Server (Views: 488)
PHP error (Views: 482)