Search…

X3 Photo Gallery Support Forums

Search…
 
tokao
Topic Author
Posts: 2
Joined: 20 Dec 2017, 05:39

Path site URL

20 Dec 2017, 10:04

Hello,
I just upgraded to X3 and moved my norai.net to my NAS.
Although I forced the site in the config to be norai.net at the footer and when I click on an album, it takes me to norai.net/norai which in fact is folder where the site is located, but I would like to remove from the url path. 
Any tips?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14010
Joined: 30 Sep 2006, 03:37

Re: Path site URL

21 Dec 2017, 00:45

tokao wrote:Although I forced the site in the config to be norai.net at the footer and when I click on an album, it takes me to norai.net/norai which in fact is folder where the site is located, but I would like to remove from the url path.
What exactly do you mean "forced the site in the config to be norai.net at the footer"?

If you have a link, I can diagnose properly and give a better answer. Sounds to me like you have some kinda redirect/rewrite rule going on OUTSIDE of X3, likely in htaccess or your Apache server rules.

Check your diagnostics page {X3website}/?diagnostics ... The SCRIPT_FILENAME should be located in the SAME dir as specified for DOCUMENT_ROOT. If it isn't, your server is misconfigured, but I have seen this before.
Image
 
tokao
Topic Author
Posts: 2
Joined: 20 Dec 2017, 05:39

Re: Path site URL

21 Dec 2017, 03:12

What I mean, is that for instance to reach an album it can be done in two ways:

http://norai.net/norai/gallery/holidays/2013/Japan/ (and this is what X3 is doing)

but also

http://norai.net/gallery/holidays/2013/Japan/

Which is what I am looking for.

The footer says norai.net/norai and I would like it to be norai.net alone.

The way I have it is with a redirect at the root of the server because I have two domain in my synology NAS, so when they reach /web it goes to the right folder:
Code
RewriteCond %{HTTP_HOST} ^(www.)?norai.net$
RewriteCond %{REQUEST_URI} !^/norai/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /norai/$1
RewriteCond %{HTTP_HOST} ^(www.)?norai.net$
RewriteRule ^(/)?$ norai/index.php [L] 
And the similar for the other domain.
The other domain, with wordpress it behaves fine. 

So first domain is in web/first domain
Second is in web/norai

Any tips?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14010
Joined: 30 Sep 2006, 03:37

Re: Path site URL

21 Dec 2017, 10:58

Check your diagnostics page:
Image

DOCUMENT_ROOT vs SCRIPT_FILENAME
Your DOCUMENT_ROOT basically says that /var/services/web is the physical ROOT of your website (which is correct), yet the SCRIPT_FILENAME includes a directory segment /norai/, which is probably ALSO correct, but there must be using some REWRITE rule (apache or htaccess) bypassing this directory in the URL (of course, because /norai/ is not included as a path in the URL norai.net/gallery/). 

X3 uses relative file paths to calculate the URL for your pages, but it can't GUESS that you have some rewrite rule somewhere else.

This is not really a correct setup, but you can try this: Go to Panel > Settings > Advanced > Force URL, and write "http://norai.net/gallery".
Image