Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
JMM
Experienced
Topic Author
Posts: 154
Joined: 02 Aug 2021, 11:18

URL shortening

28 Jan 2022, 13:34

Good day again, Karl.

If you take a look at THIS page, I have it displaying correctly, which is great.  However, take a look at the long URL:
Would it be possible for me to leave that directory structure (that you can see from the URL) where it is, in order to keep my X3's structure tidy, but be able to call that page from:
or even better for me & preferable: 
I realize that last year you told me that X3 is written in Ajax (I believe), but my PHP code works fine when displaying the screens.  My bigger issue will be trying to get the PHP script code to work, but I will submit a separate topic for that shortly.

Any suggestions on how I can shorten the URL would be greatly appreciated.  Thank you ion advance.
Location: Burlington (Toronto-ish), Ontario, Canada
Self-hosted using Abyss Web Server:   AuroraWings.me   |   GalleryWings.com   |   PanAurora-Studio.com   |
Externally-hosted using LiteSpeed/Apache Web Server:   GenealogyWings.com/galleries   |
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: URL shortening

28 Jan 2022, 23:30

You can add your stat scripts in ANY location on your server, separately from X3. Although you are using it in X3, it's not part of X3, so you just need to make sure your paths are correct when implementing. Did that answer the question?
 
User avatar
JMM
Experienced
Topic Author
Posts: 154
Joined: 02 Aug 2021, 11:18

Re: URL shortening

30 Jan 2022, 01:32

Thanks for your reply, Karl, but I am still having issues.  It's my fault, because I didn't explain it clearly in my original post/

On my dozen or so (non-X3) sites, I place such things like scripts completely outside of where my domains (public folders) point to, and then use Linux's symbolic links to point to the scripts.

This particular X3 domain of mine points to:
public_html/jenjo.family/cms/x3

This is my folder structure for X3 & my script:
public_html/jenjo.family/cms/x3
public_html/jenjo.family/scripts/reference/phpwebstat
I want myself & users to be able click on the ? button in my footer, and be taken to my stats page (that ? button in my footer would point to):
But because my domain points directly to my X3 installation, and as my script resides outside of X3, the only way I know how to make it work, is to use symbolic links.

My symbolic links that I created are:
Code
cd public_html/jenjo.family
ln -s /home/panauror/public_html/jenjo.family/scripts/reference/phpwebstat webstats

cd cms/x3
ln -s /home/panauror/public_html/jenjo.family/scripts/reference/phpwebstat webstats
However, the symbolic link that I need to place somewhere inside of X3, I don't know where to place it.  So my question is: In what X3 location (subfolder) would I put that 2nd symbolic link?  Placing it in the root of X3 comes up with 404; when I placed it in Content, it came up as a gallery; when I placed it in Custom, it came up with 404; when I placed it in Files, it came up with 404, etc.

I can live with it in X3's structure, with the long URL (which is where the ? button in my footer currently points to temporarily):
but I would much prefer it to reside outside of X3, and with this short URL

Any advice or suggestions would be sincerely appreicated.

Thank you in advance, Karl.
Location: Burlington (Toronto-ish), Ontario, Canada
Self-hosted using Abyss Web Server:   AuroraWings.me   |   GalleryWings.com   |   PanAurora-Studio.com   |
Externally-hosted using LiteSpeed/Apache Web Server:   GenealogyWings.com/galleries   |
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: URL shortening

30 Jan 2022, 02:40

JMM wrote:This particular X3 domain of mine points to:
public_html/jenjo.family/cms/x3
So just to be clear then, your X3 website ROOT points to public_html/jenjo.family/cms/x3. Therefore, anything you want PUBLIC on your website, needs to be somewhere within that DIR. You don't have to put your custom scripts inside SUBFOLDERS of X3. For example, if you have public_html/jenjo.family/cms/x3/myfile.php, it will be avaialble from yourwebsite.com/myfile.php. In your case, you are already using symlinks and then you want to use symlinks inside already symlinked paths? OK no problem, but you are making it more difficult than it needs to be.

My point is, this isn't really related to X3. As long as your website root points public_html/jenjo.family/cms/x3, then anything public most also go inside that dir. You can of course create symlinks from within that dir again to other locations on disk ... In your example, it seems you need some public_html/jenjo.family/cms/x3/phpwebstatSYMLINK that points to public_html/jenjo.family/scripts/reference/phpwebstat. You could of course add the symlink into an X3 subfolder, but there is no logical reason why you would need or want to do that.
JMM wrote: I want myself & users to be able click on the ? button in my footer, and be taken to my stats page (that ? button in my footer would point to):
Personally I am not sure why you need to make webstats non-public if it's meant to be public, but ok. In the case above, you would create a symlink "public_html/jenjo.family/cms/x3/webstats" which points to public_html/jenjo.family/scripts/reference/phpwebstat. X3 does not dictate how you add non-X3 custom files, including symlinks.
JMM wrote:However, the symbolic link that I need to place somewhere inside of X3, I don't know where to place it.  So my question is: In what X3 location (subfolder) would I put that 2nd symbolic link?  Placing it in the root of X3 comes up with 404; when I placed it in Content, it came up as a gallery; when I placed it in Custom, it came up with 404; when I placed it in Files, it came up with 404, etc.

There is no reason the symlink would work better in a subfolder, because X3 does not process symlinks in any way. The only reason it would not work, would be if the symlink points to wrong location, or the .htaccess REWRITE rule is ignoring your symlink (but it shouldn't do that, because the rewrite rule is setup to ONLY point to the X3 application if the requested file path does NOT exist).

Why not setup your webstats as a sub-domain webstats.jenjo.family? It is after all meant to be public, and there is no "security" benefits of making it non-public if you are making it public by symlinks anyway. With a sub-domain, you could change symlink location of your domain without affecting where webstats is located.
 
User avatar
JMM
Experienced
Topic Author
Posts: 154
Joined: 02 Aug 2021, 11:18

Re: URL shortening

30 Jan 2022, 06:49

Thanks, Karl, it's working perfectly now, since I moved the stats folder to the root of X3, and it's also logging entries.

The only reason why I was trying to use symbolic links, was because that's how I was taught many years ago by my hosting company.  All is good now, Sir.

Have yourself a splendid day.

Regards,
John
Location: Burlington (Toronto-ish), Ontario, Canada
Self-hosted using Abyss Web Server:   AuroraWings.me   |   GalleryWings.com   |   PanAurora-Studio.com   |
Externally-hosted using LiteSpeed/Apache Web Server:   GenealogyWings.com/galleries   |