Search…

X3 Photo Gallery Support Forums

Search…
 
webbly
Topic Author
Posts: 4
Joined: 26 Jul 2022, 06:09

404 Error

26 Jul 2022, 06:37

Hi, I am trying to setup a new X3 website, which I already did sucessfully for two other X3 sites on other servers. But now I need to do it on a "Network Solutions" Server and having a big problem right in the beginning. 

I can setup the system, access the panel and view the website. But as soon as I generate sub-sites like pages or galleries they appear in the menu but when I click them I get 404 errors every time. What could be the reason? Example here when you click on "collectors":

https://0061108.netsolhost.com/x3website/
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: 404 Error

26 Jul 2022, 07:46

Hi! I checked your website, and I think it can easily be explained at least.

1. X3 uses rewrite rules to be able to use virtual url's (like most website applications). By default, a .htaccess file is included with X3, that allows rewrite rules to work on Apache servers.
https://gist.github.com/mjau-mjau/d9f8b ... 6245a31fd3


2. After checking your website, I see your website is using openresty as server. This server does not use .htaccess, but is instead "like" NGINX, and apparently it can use NGINX configuration files.

3. So just like NGINX, if you want to use X3 on this server with rewrite rules, you need to setup a configuration which tells how the rewrite should work. I already have a working example of NGINX config for X3, and assume it should work for openresty:
https://gist.github.com/mjau-mjau/6dc19 ... e566a8457b

* The above will likely need some adjustments to the assigned paths since you are using X3 in a subfolder.

In conclusion, as long as you are not using Apache server (most hosting), you need to prepare your own config.
 
webbly
Topic Author
Posts: 4
Joined: 26 Jul 2022, 06:09

Re: 404 Error

26 Jul 2022, 07:54

Thank you so much for your quick and helpful answer! I am not deep into web developing so I never stumbled across this, but I will try to get it going with the code you linked to. It definitely helps a lot to know where the problem is located :)
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: 404 Error

26 Jul 2022, 08:05

It's "easier" if you could choose "Apache" web hosting from your hosting provider. Other servers like NGINX, Lighttpd and Openresty normally require some configuration to setup apps that require rewrite rules (even Wordpress). I checked network solutions website, and find it peculiar if they only offer Openresty by default with no choices or information up front.

It can be done of course. Just a head-up  :clap:
 
webbly
Topic Author
Posts: 4
Joined: 26 Jul 2022, 06:09

Re: 404 Error

26 Jul 2022, 09:12

I am still struggling, yes the last option would be moving it to another server. The Network Solution Support is telling me they use Apache Servers and htacess already now, but can't tell me why its not working then. Very weird... 

I tried to setup the nginx configuartion but my knowledge does not seem to be enough to do that properly, or it just doesn't work.  
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: 404 Error

26 Jul 2022, 09:53

webbly wrote: I am still struggling, yes the last option would be moving it to another server. The Network Solution Support is telling me they use Apache Servers and htacess already now, but can't tell me why its not working then. Very weird... 
Looking at your server output, I see this:
Image

Interestingly, your ?diagnostics page reports "Apache", but even this outputs from the actual response that it is served by "openresty":
https://0061108.netsolhost.com/x3website/?diagnostics
Image

In this we can probably conclude this: The hosting is using Apache + openresty combined. It is not unusual to combine Apache with Nginx (or openresty), but in this case, the openresty is clearly serving the requests including the "404" response because it cannot find the "file" (because it's virtual, handled by the .htaccess). I have dealt with this issue earlier ... If Nginx (or openresty) does not forward "404" to Apache, then obviously Apache cannot handle the rewrite from .htaccess. In either case, surely the service that hosts this website cannot say they are not using "openresty", in which case this is the server that is handling the requests before forwarding them to Apache.

Are you 100% sure this is actually hosted by "network solutions" and not Netsolhost? Or maybe they are the same thing? This is not clear. Even if I go to https://netsolhosting.com/, it reports "Apache" (as opposed to "openresty" on your website):
Image
webbly wrote:I tried to setup the nginx configuartion but my knowledge does not seem to be enough to do that properly, or it just doesn't work.  
It would be counter-productive if you would have to do this on a server (openresty) that you did not specifically sign up for without prior knowledge (mine is limited to). It's probably possible, but it doesn't seem useful. Where exactly did you sign up for this service?
 
webbly
Topic Author
Posts: 4
Joined: 26 Jul 2022, 06:09

Re: 404 Error

26 Jul 2022, 13:06

Thanks for your reply and your effort! Its absolutely possible its a combination of those servers as you suggest. I am sure its hosted by Network Solutions, the website is for a friend so I didn't specifically set it up for X3. He had this account earlier with a domain and a koken installation and now I am trying to change it to X3. When I log into the Network Solutions backend I see the server adress netsolhost as I linked it earlier. Maybe they are connected somehow, I don't know. 

I think I will end up convincing my friend to get some other webspace. But thanks for your help again!