Sietse
Sietse

Reputation: 693

How can I load files from httpdocs on the https side of the website

On my webserver. I have two directories which are publicly accessible. One of those is httpdocs/ and the other is httpsdocs/. You can probably guess where they're for.

The problem occurs when I wanted to create a CMS for myself. I want it to load the page with HTTPS for security reasons, but the problem is that my files are inside the httpdocs directory. I can move only the files for the system to the httpsdocs, but my next thought was what if I want a login on the normal website for people to login and view hidden content for not registered users?

Now my question is: Is there a way to combine those to directories so all the files will be inside the httpdocs and I can access them with the security HTTPS provides?

Things that you may need to know:

Upvotes: 2

Views: 666

Answers (2)

Christian Riesen
Christian Riesen

Reputation: 709

There are a ton of avenues, but most are blocked if you can't alter the httpd.conf or certain restrictions are in place.

Your best bet would probably to simply abandon http: and just stick to https: and create a redirecting .htaccess in the http: folder. That way everything runs on a single directory.

Unless there is a drawback that would not allow your users to use HTTPS over HTTP.

Getting your ISP to make the https folder a symlink to the http folder would be the easiest solution here.

Upvotes: 1

Drahkar
Drahkar

Reputation: 1671

It sounds like you are likely using a hosting service that has things seperated. If this is the case then the answer is no, you can't combine these two directories into one. You can ask your provider if they can make that arrangement, but it would require changes to the apache configuration that you can't do.

That being said, barring the ability to have that configuration modified, the only other answer you are going to find is to move everything under the httpsdocs directory. Unless you can get another account setup or possibly if they offer the ability to setup subdomains with HTTPS connections. That would be an alternative solution.

Upvotes: 1

Related Questions