Site SSL leads to different directory - ssl

I have enabled SSL on my site. My problem is that https leads to a different directory. Directory should be same for SSL. I am using Parallel Plesk and not much aware about it. Can you please help to solve this issue.

Some hosting companies give you SSL, but it has it's own directory. It is expected that you'd put any pages that require SSL in that directory.
It's not the best setup, but it looks like you've got that arrangement.

Related

Primary SSL re-routing HTTP add-on

As a complete newbie, I've been skulking through this site for about the past twelve months to find solutions to errors. The following issue has driven me to distraction to such a degree that I decided to join the fun and see if anyone can help.
I have a main site which has an essential SSL certificate. I recently created another site as an add-on domain to the main hosting. However, this means the add-on tries to run as https, causing a security error and blocking most of the html and css document. I'd be very grateful if anyone could offer advice on how to work around this.
The certificates are valid only for the domain specificed in the CN.
However you are not only one with this requirement, so what you can do:
use a wildcard certificate - the wildcard certificates are usually more expensive, but they cover all subdomain on that level (*.domain.com covers www.domain.com, mail.domain.com, ... but not domain.com itself)
use Subject Alternative Name - it is an explicit list of domiains covered by the certificate

Correct Apache Configuration And Htaccess

I've just reset my Ubuntu 14.04 LAMP server hosted with digital ocean. Could someone tell me the 'proper' way to do server configuration. My goal is to do everything as clean as possible (and hopefully well structured).
I intend on using the server mainly for programming and data analytics, however I do plan on hosting my website in /var/www/html. I also plan on using letsencrypt/certbot to get an easy SSL. With this in mind, these are the main goals I would like to accomplish:
1) Redirect the website to ALWAYS be served through https AND www.
2) Enable HSTS for the entire website.
3) Enable clean url's (remove .php extensions and what not).
Since I would like all of these properties to be used across the entire website, should the configuration be done inside of the /etc/apache2/ folder? Or should it be done inside of .htaccess?
And if it should be done inside of apache2 configuration, which file should I add it to? And finally, how exactly should it be added? (for example vhost 80/443, inside of a mod_something section, etc).
Thank you in advance, I would appreciate and consider any advice about Apache and htaccess!

HTTP access was forced to visit HTTPS

I have a few web sites that are hosted in a VPS.
Today, I found that when visiting "http://api.rsywx.com", it forces me to visit "https://api.rsywx.com", and the redirects me to "https://rsywx.net" (which is SSL enabled).
I checked my virtual host files, and did not find out anything forcing this redirect.
Anyone can point me some direction on how this can happen?
Redirects can be done on different ways and levels. Most elegant ways in descending order (my opinion):
Apache conf (mostly in /etc/apache2/apache2.conf)
.htaccess - file
in the index.php or the used backend script/code
(- could be even done in the frontend with javascript files but for that the page must be loaded and then will be redirected.. So nothing somebody should use)
Problem solved. I added one line in my Silex application's entry index.php to require HTTPS access, which is meant to be locally tested only.

htaccess complex setup for SSL proxy for images

I need a help to setup a complex .HTACCESS rule.
My site (abc.com) has SSL setup.
The gallery images are hosted in an external site pqr.com, it doesn't have SSL.
I want, if my site (abc.com) is opened in ssl (that is https://abc.com) the external images (jpeg or png) that are coming from pqr.com will use a SSL proxy.
Example - http://pqr.com/pic1.png will convert into https://abc.com/proxy/pqr.com/pic1.png
How to do it?
To convert http://pqr.com/pic1.png to https://abc.com/proxy/pqr.com/pic1.png - you will need rules on external domain pqr.com and also need the same images on abc.com (which will not make any sense).
The other option is to install SSL on pqr.com and provide secure access. Check out this article and see if SSL installation is really needed for pqr.com.
Hope this helps!

Apache like Rewrite Rules in Openshift

I have configured Jboss7 on Openshift yesterday. All I need to have an internal rewrite rule to have /members.html -> members.jsp.
This requires user to see members.html while the actual file(members.jsp) is served by Jboss itself.
Dont know correctly how to setup mod_jk if required but surely I would like this thing to work anyways as I have urls submitted in google and shifting site on openshift should not require me to change the URLs.
I don't think you have access to the Apache configuration on the server. You would need root permissions for that. Have you considered an alternative approach via a web application filter. There is UrlRewriteFilter - http://tuckey.org/urlrewrite/ - which might solve your problem.