Jump to content

Force SSL on all pages but one URL


Recommended Posts

Hello,

 

I have successfully forced SSL on all of my pages and it works great , but I need two of my custom html files to be loaded from without SSL...

 

for example I have two files one file1.html located in root and one file2.html located in a folder (folder/file2.html) ... I want these to be SSL free .

 

I searched in forum and I have not found any instructions to do this.

 

So I tried to use .htaccess codes but if I do so some conflicts would happen with prestashop's force SSL option.

 

And finally if I disable prestashop's force SSL option it gives me a redirect loop.

 

 

I would really appreciate your help regarding this issue.

 

Than you very much.

Link to comment
Share on other sites

Thank you for your reply,

 

Well I edited the header tpl file and put a linked image there which is being linked to "folder/file2.html" and inside the "File2.html" , my other file "file1.html" is being loaded in an iframe.

 

I hope you get it :)

 

 

(Please don't tell me that this is ridicules because this this a rule in my customer's country that all verified online stores should have this verification badge on their websites. And the problem is that this badge image is not being loaded from the source is not secured by SSL and this is my main problem :(    ) .

 

 

Thank you very much again for your reply.

Link to comment
Share on other sites

Thank you for your reply,

 

Change my link ?

 

If you mean the link related to that image , well it is HTTP and this is the first thing that I did ...

 

 

and if you mean the whole SSL , I think it would not be an option too because mu customer is insisting on having SSL for security reasons ...

 

I wonder why Prestashop would change http to https considering the fact that those files are not native prestashop files ?

 

 

Every .htaccess code that I used , caused a redirect loop ... would you have any other suggestions ?

 

 

Thank you very much.

Link to comment
Share on other sites

I wonder why Prestashop would change http to https considering the fact that those files are not native prestashop files ?

 

As I said previously, this has nothing to do with Prestashop.  These are files you created

 

Well I edited the header tpl file and put a linked image there which is being linked to "folder/file2.html" and inside the "File2.html" , my other file "file1.html" is being loaded in an iframe.

 

You added file2.html and file1.html.  These are not Prestashop files.

 

So go back into header.tpl and change the links you added so they do NOT use HTTPS.  If you want them to be HTTP, then change the link you added

Link to comment
Share on other sites

Thank you again,

 

Here is my Header :


And this is the part that I have problem with :

<div id="enamad"><div class="enamad"><a href="http://MyDomain.com/enamad/index.html"  style="text-decoration:none; float: left;">				    <img alt="Electronic Namad " src="https://MyDomain.com/namad2.png" style="border: 0px;" style="float:left;margin: 0px;" width"100px"  /></a><br /><br />				<a href="#"  style="text-decoration:none; float: left;">				    <img alt="SSL" src="https://www.instantssl.com/ssl-certificate-images/support/comodo_secure_100x85_transp.png" style="border: 0px;" style="float: left;"/><br />				    <span style="float: left;font-weight:bold;font-size:10px; font-size:1.0 rem;padding-left:10px; color:#86BEE0;">Secured by SSL</span>				    </a>				</div></div>
Edited by a.chakery (see edit history)
Link to comment
Share on other sites

Yes exactly,  please test it yourself ...

 

http://easyvshop.com/enamad/index.html

 

 

and here is the content of index.html :

<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>ENamad</title>
  <style>
    body { background-color:#1A4D80; margin: 0; padding: 0;}
    body,td { font-family: Tahoma; font-size: 12px; font-weight: normal; }
    a { color: #203F77; }
    
  </style>
</head>
<body bgcolor="#1A4D80">
<table bgcolor="#1A4D80" width="100%"><tbody><tr><td>
<br><br>
<table align="center" bgcolor="#efefef" cellpadding="15" cellspacing="10" width="650">
<tbody><tr>
<td bgcolor="#ffffff">
<div align="center"><a href="https://easyvshop.com/" target="_blank"><img src="https://easyvshop.com/img/--logo-1429903048.jpg" alt="  " border="0" width="200"></a></div><hr style="color:#1A4D80">

<br /><br /><br /><br />
<div align="center" style="font-family:tahoma" direction:"rtl"><br />
<iframe src="http://easyvshop.com/eNamadLogo.htm" frameborder="0" scrolling="no" allowtransparency="true" style="width: 150px; height:150px;"></iframe>
</div>
<br /><br /><br /><br />

<br /><br /><br /><br />
<div style="font-family:tahoma" align="center">Content</div>
</user-ip></div>
</td></tr></tbody></table>
</td></tr></tbody></table>
</body></html>
Link to comment
Share on other sites

Oh and by the way here is my .htaccess file ...

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums



<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>



#Domain: easyvshop.com
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api$ api/ [L]

RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]

# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</IfModule>

AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff .woff
<IfModule mod_headers.c>
	<FilesMatch "\.(ttf|ttc|otf|eot|woff|svg)$">
		Header add Access-Control-Allow-Origin "*"
	</FilesMatch>
</IfModule>

<IfModule mod_expires.c>
	ExpiresActive On
	ExpiresByType image/gif "access plus 1 month"
	ExpiresByType image/jpeg "access plus 1 month"
	ExpiresByType image/png "access plus 1 month"
	ExpiresByType text/css "access plus 1 week"
	ExpiresByType text/javascript "access plus 1 week"
	ExpiresByType application/javascript "access plus 1 week"
	ExpiresByType application/x-javascript "access plus 1 week"
	ExpiresByType image/x-icon "access plus 1 year"
	ExpiresByType image/svg+xml "access plus 1 year"
	ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
	ExpiresByType application/font-woff "access plus 1 year"
	ExpiresByType application/x-font-woff "access plus 1 year"
	ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
	ExpiresByType font/opentype "access plus 1 year"
	ExpiresByType font/ttf "access plus 1 year"
	ExpiresByType font/otf "access plus 1 year"
	ExpiresByType application/x-font-ttf "access plus 1 year"
	ExpiresByType application/x-font-otf "access plus 1 year"
</IfModule>

<IfModule mod_headers.c>
	Header unset Etag
</IfModule>
FileETag none
<IfModule mod_deflate.c>
	<IfModule mod_filter.c>
		AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/x-javascript font/ttf application/x-font-ttf font/otf application/x-font-otf font/opentype
	</IfModule>
</IfModule>

#If rewrite mod isn't enabled
ErrorDocument 404 /index.php?controller=404

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again



# 1 WEEK
<FilesMatch "\.(ico|pdf|flv|swf|css|js|wof|ttf)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
# 24h
<FilesMatch "\.(jpg|jpeg|png|gif|html)$">
Header set Cache-Control "max-age=84600, public"
</FilesMatch>


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...