HTTP Error 404. The requested resource is not found

9.1.x

#1

Hi guys!
My Owncloud works fine using http but I tried to redirect traffic to https and got "HTTP Error 404. The requested resource is not found."



In order to redirect to https I added "Redirect permanent / https://my.server.com/" to the top of /etc/httpd/conf.d/owncloud.conf

Owncloud is installed on CentOS 7.
I spent a lot of time in google trying different solutions but it's not working. What could be the issue?
Thank you.


#2

Hi.

The redirect has to be entered in your Apache conf. Either sites enabled or available. In the virtual host entry. Here is the page from the docs.

https://doc.owncloud.com/server/10.0/admin_manual/configuration/server/harden_server.html#redirect-all-unencrypted-traffic-to-https


#3

Hi dmitry,

The thing is it's working with http even without any virtual host configured. I'm using a basic config. So, I'm wondering why it's not working when I use the redirection.


#4

Maybe you can find some information about this issue in the Apache documentation?

https://httpd.apache.org/docs/2.4/vhosts/index.html
https://httpd.apache.org/docs/2.4/vhosts/examples.html


#5

Hi tom42,

Thank you. I tried httpd -S but it's not helpful in my case. Concerning virtual hosts, Owncloud works with http even without any configured. So, I'm assuming the issue is not related to that.


#6

I think its fully related to the vhosts and the way you're trying to configure it.

From what i know ownCloud is just a bunch of PHP files which are hosted by your web server. So there is probably something wrong / different in the configuration of http and https. Maybe you're redirecting from http to https but the https vhost is not serving ownCloud at all?