Hi Hugo,
Thank you for your help.
I've build the pem file in the order you shown. Now the problem is that although hiawatha starts fine, it's not possible to visit https pages.
When Result
http://myserver.pt fine, url changes to http://www.myserver.pt/some.php
http://www.myserver.pt fine, url just adds /some.php
https://myserver.pt fine, url changes to http://www.myserver.pt/some.php [NOTE: http, not https]
https://www.myserver.pt Secure Connection Failed
An error occurred during a connection to www.myserver.pt.
SSL received a record that exceeded the maximum permissible length.
(Error code: ssl_error_rx_record_too_long)
My config of hiawatha.conf is as follows: (relevant parts)
Binding {
Port = 80
MaxKeepAlive = 30
TimeForRequest = 5,30
MaxRequestSize = 512
}
Binding {
Port = 443
MaxKeepAlive = 30
TimeForRequest = 5,30
}
VirtualHost {
Hostname = myserver.pt
UseToolkit = redirect
WebsiteRoot = /usr/local/www/prestashop
}
VirtualHost {
Hostname = www.myserver.pt
WebsiteRoot = /usr/local/www/prestashop
StartFile = index.php
UseFastCGI = phpfpm0
TLScertFile = /usr/local/etc/hiawatha/myserver.pt.pem
}
UrlToolkit {
ToolkitID = redirect
Match ^/(.*) Redirect http://www.myserver.pt/$1
}
So, there are two problems:
1. the redirect from https://myserver to http
2. the error when acessing https://www.myserver
How to solve these issues?