Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
Haider of Sweden
Experienced
Topic Author
Posts: 54
Joined: 09 Jan 2013, 05:02

Subdomain-related problem

29 Sep 2017, 09:50

Hi!

I used to run Imagevue on a subdoman and everything worked fine until recently when I updated.

The webhost I am using treats a sub-folder as subdomain. So I uploader the installer to a location like this: www.domain.com/subdomain/x3_updater.php.
Then I run the installer from a location like this subdomain.doman.com/x3_updater.php

It seems like everything went well, but when I e.g. galleries, it tries to load the images from subdomain.domain.com/subdomain/galleries/landscapes - I bold-marked the occurrence of "subdomain".

What could be the cause?
Kind regards,
Haider
www.haider.se
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

Re: Subdomain-related problem

29 Sep 2017, 23:27

Without a link, I can't get into too much detail, but I can confirm the following:

Your server (Apache I presume) isn't set up properly with subdomains. Subdomains should be defined in the Apache config file, for example:
Code
<VirtualHost *:80>
  DocumentRoot /var/www/domain/subdomain
  ServerName subdomain.domain.com
</VirtualHost>
If you do the above,  then the subdomain is a website in it's own right. It doesn't really know or care that it's a subdomain of the primary domain or not. It's path is always subdomain.domain.com.

It seems your server is setup with a htaccess *WILDCARD* rewrite setup, that just checks ***.domain.com, and tries to map it to domain.com/***/ (if *** exists). This is not really a subdomain at all, just an URL rewrite. It seems you simply have a REDIRECT in a .htaccess file at some level, which REWRITES /subdomain/ to subdomain.domain.com.

X3 needs to calculate the relative PATH of the X3 app, and it does this with $_SERVER variables. Your server variables are returning values from the true path domain.com/subdomain/ instead of the subdomain.
So I uploader the installer to a location like this: http://www.domain.com/subdomain/x3_updater.php.
Does that mean ALL your subdomains mydomain.domain.com are ALSO available from domain.com/mydomain/? Bad practice.

If you check your URL/?diagnostics, you will see PATHS (at the bottom of page) which confirm this. I am wondering what hosting service would not have a proper subdomain setup?
 
User avatar
Haider of Sweden
Experienced
Topic Author
Posts: 54
Joined: 09 Jan 2013, 05:02

Re: Subdomain-related problem

30 Sep 2017, 13:55

Hello,

I was assuming it was something like this.
Here is the diagnostic link, could you please confirm your suspicion?

http://dev.gridark.se/?diagnostics
compared to 
http://www.gridark.se/?diagnostics

The web hosting service is One.com and the support confirmed they don't provide proper subdomains. I will suggest my employer to switch to a proper web hosting service.
Kind regards,
Haider
www.haider.se
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

Re: Subdomain-related problem

01 Oct 2017, 04:44

The DOCUMENT_ROOT server variable is identical in both links:
Code
DOCUMENT_ROOT	/customers/e/8/4/gridark.se/httpd.www
That would be correct for www.gridark.se, but for dev.gridark.se, the document root should be /customers/e/8/4/gridark.se/httpd.www/dev. Instead, you have some kinda rewrite or redirect, but that doesn't work for PHP/applications that need to get data relative to document root (which is not correct).
 
User avatar
Haider of Sweden
Experienced
Topic Author
Posts: 54
Joined: 09 Jan 2013, 05:02

Re: Subdomain-related problem

01 Oct 2017, 06:02

I'll run the dev-page as sub-folder and recommend my employer to switch to a proper web hosting service.
Thank you for helping me understand. :thumbsup_tone1:
Kind regards,
Haider
www.haider.se