Change HTTP to HTTPS?

I've been working on this for two days, and still can't seem to find the issue. I placed on an SSL Certificate and followed the following directions:



http://kb.cs-cart.co…tps-whole-store



.htaccess file:


```php DirectoryIndex index.html index.php





RewriteEngine on

Some hostings require RewriteBase to be uncommented

Example:

Your store url is http://www.yourcompany.com/store/cart

So “RewriteBase” should be:

RewriteBase /store/cart

RewriteBase /subdirectory

RewriteCond %{SERVER_PORT} 80

RewriteRule ^(.*)$ https://www.place4musicians.com/music/store/$1 [R,L]

RewriteCond %{REQUEST_FILENAME} !.(png|gif|ico|swf|jpe?g|js|css)$

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php?sef_rewrite=1 [L,QSA]



```



Section of func.php file:


function fn_seo_is_indexed_page($request)
{
if (defined('HTTPS')) {
// return false;
}




The problem:

The shopping cart works fine, however after checking my error console I found that when I typed the URL to my Admin Panel that the redirect was not to HTTPS but to HTTP. Also User Profiles do not show when selected, for the same reason. Am I missing something? Thanks for any assistance you may be able to provide.

Clear your cs-cart cache and your browser cache.

Why are you using the RewriteBase versus simply letting cs-cart do it via the http_path in config.local.php?

Thank you tbirnseth, that seemed to do the trick on that, but now I seem to have another problem but it is based on e-mail. Should I create another post? I have read many a topic on the issue, but none of the advice seems to work. I changed my settings to:



Method of sending e-mails: via SMTP server

SMTP Host: smtp.gmail.com:587

user name and password are set correctly

SMTP Authentication, have tried this both on and off.



I'm not sure what “Path to sendmail program” is.



These are the errors that I'm receiving:



Error

SMTP Error: Could not connect to SMTP host.



Error

Message could not be sent.

Mailer Error: SMTP Error: Could not connect to SMTP host.



I have tried both port 465 and 581. I use port 581 on my forum and it works fine.



I'll be happy to post this in a new thread if you like.



Oh, I forgot to mention that the reason I started using gmail was because my server was taking up to 24 hours for a message to be sent.

[quote name='Syxguns' timestamp='1364725446' post='159032']Method of sending e-mails: via SMTP server

SMTP Host: smtp.gmail.com:587

user name and password are set correctly

SMTP Authentication, have tried this both on and off.[/quote]



I think, you don't need to add the port to the “SMTP Host”.


[quote]I'm not sure what “Path to sendmail program” is.[/quote]



This doesn't need to be changed.

The port is forced in the phpmailer class to port 25 (it should be an admin setting in the SMTP setups, but it is not). So adding the port to the hostname is not being parsed how you expect.



The best way to change the port to 587 is to add a function in your my_changes/func.php called


fn_my_changes_send_mail_pre(&$mailer) {
$mailer->Port = 587;
}


Then add a line (or an argument) to your init.php file of:


fn_register_hooks('send_mail_pre');




This should set the port of the mailer class to 587 for you.

Simply said, there isn't a need to change the default smtp port to something else - if you use a good configured firewall. Untill the default smtp port has been blocked by your ISP for some reason like a computer gets infected by a virus and it can be hijacked by the virus to send spam emails.

[quote name='tbirnseth' timestamp='1364757022' post='159059']

The port is forced in the phpmailer class to port 25 (it should be an admin setting in the SMTP setups, but it is not). So adding the port to the hostname is not being parsed how you expect.



The best way to change the port to 587 is to add a function in your my_changes/func.php called


fn_my_changes_send_mail_pre(&$mailer) {
$mailer->Port = 587;
}


Then add a line (or an argument) to your init.php file of:


fn_register_hooks('send_mail_pre');




This should set the port of the mailer class to 587 for you.

[/quote]



I tried this by creating the func.php and adding it to my_changes but it did not work. I do not have a func.php file already located there. I also added the line at the bottom of the init.php, but with those two changes in place all I got was a line of code at the top of the store that read the contents of the func.php file that I created.



Maybe I didn't follow the directions the correct way.



Edit: I also just did a test and I was directed to: Hook fn_store_send_mail_pre is not callable which tells me that I need to remove that line of code in the init.php file.

Martfox - Depends on the hosting provider. Some disable port 25.

Jeff - Sounds like when you created the func.php file you didn't use the opening and closing PHP tags.

Replace your func.php file with this content

```php

if( !defined('AREA') ) die('Access denied');
fn_my_changes_send_mail_pre(&$mailer) {
$mailer->Port = 587;
}
?>

```

and for my_changes/init.php use:


```php

if( !defined('AREA') ) die('Access denied');
fn_register_hooks('send_mail_pre');
?>

```

[quote name='tbirnseth' timestamp='1364841021' post='159101']

Martfox - Depends on the hosting provider. Some disable port 25.[/quote]



That's right, “some”…

You could also change the port via php.ini.

tbrinseth, you were correct. I don’t code, I tend to copy and paste! ooops ;)



The assistance has been much appreciated and I finally have e-mail working. Now the funny thing is that I keep finding other small issues to deal with!


  1. My hyperlink for digital download is not directed to https! Now after a purchase the link brings up a “can’t find page” if you add the “s” the page shows.


  2. My max file size I have set to 150mb, but if I FTP a 32mb item to the server and set the download it is read as 0 on file size. This is the first time I’ve used 7-zip, but I even made 3 separate download links for the item after I split it into sections and I’m still suffering from the same problem.



    Do you have any suggestions for these issues?



    I need to change the thread title to “multiple issues with SSL Certificates”!



    Sent from Samsung GS3

[quote]

You could also change the port via php.ini.

[/quote]

That only works for PHP Mailer, not SMTP and the phpmailer class in cs-cart.

Yes, new thread wold probably be best.

Your host may impose a maximum file download size on your server.

CS-cart also imposes a max but I don't remember off the top of my head what it is.

I can't really help you here without spending time in research.

[quote name='tbirnseth' timestamp='1364927556' post='159174']

That only works for PHP Mailer, not SMTP and the phpmailer class in cs-cart.

[/quote]



Then why do they call it “smtp_port”?

Because it's the SMTP port that is used by the “php mail function” which is different than the phpmailer class used in cs-cart when “SMTP server” is specified as the mail service. If he used the “php mail function” then the port in the php_ini (or done via php ini_set() function) would apply, but he's using the “SMTP server” method instead.

I know you said to start a new thread, but I finally figured out one of my two problems!! :mrgreen:



It seems I have to type the url for the download and can not select the server link to do it! Why, I don’t know. My file size was 32MB but after I tried separating it into smaller files and still having the same issue over and over again I just thought I would try the URL and type it in and low and behold… it worked! What a pain to get that going eh!! :shock:



Now for the second problem I found this link while searching tonight: Download links in emails don't work v.2.0.14 - Issues & Troubleshooting - CS-Cart and Multi-Vendor Community Forums | Connect with the Community | Find Solutions I haven’t had time to really had the time to investigate it in full, but the answer may be there. What do you think?



The Tool,

I thought about trying the phpmailer option, but as I was doing a lot of research I found that I would have to do some file swapping with a new copy of phpmailer. In the process of searching I had a difficult time finding a set of instructions that was more to a “I can modify code” kind of guy like me. I really need an in depth step by step guide. I say this because in the year and a half that I’ve been building my site I’ve destroyed it countless times by changing code. I finally got a second domain to test on, and that was a life savor for me. I appreciate the comments though. I did try to change the port in the php.ini but I had no success with it.



Thanks for the assistance, you all have been a great help in all of the shenanigans that started taking place after placing on the SSL.