Hello all,
I've come across a peculiar behaviour in the URL hierarchy of CMSMS and I wanted to ask if anyone had come across this problem and figured out a way to resolve it?
Basically if I go to:
mysite.com/parentA/childA
I will be sent to the childA page. Now if I then go to the same page but using a different parent:
mysite.com/parentB/childA
I still get directed to the same page but the URL hasn't changed. So to the average user that would mean that childA has been created under parentA and parentB; when in fact it is only under parentA and should either be redirected or show an error when called under parentB.
Now I know to be able to use page aliases as "shortcuts" they must be unique per page and can be used shorthand:
mysite.com/childA
That's fine but it almost seems like the issue I have found is a bug as a result of this.
Currently the only solution I can come up with is to use CGSimple to check if the current page alias is a child of the parent declared in the URL and redirecting to the correct URL if not.
Any other ideas would be very helpful as I am concerned with how this might affect Google and the inconsistency in this doesn't make sense.
Thanks
Mr. Enigma
[SOLVED] URL hierarchy help
[SOLVED] URL hierarchy help
Last edited by mrenigma on Mon Aug 27, 2012 11:36 pm, edited 1 time in total.
~ Life is like water, every movement you make changes the way it flows ~
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: URL hierarchy help
This has been asked and answered numerous times before:
a: CMSMS supports accessing a page from many different URLS
"http://mysite.com/index.php?page=alias {* pretty urls turned off *}
"http://mysite.com/index.php/alias {* internal pretty urls *}
"http://mysite.com/index.php/a/url/i/ent ... ng/content {* internal pretty urls *}
"http://mysite.com/alias {* mod_rewrite *}
"http://mysite.com/some/random/path/to/alias {* mod_rewrite *}
"http://mysite.com/a/url/i/entererd/when/editing/content {* mod_rewrite *}
This is NOT a bug.
b: Search engines like google recognize the fact that there may be numerous relative paths and/or arguments attached to a page, that all point to the same URL.
i.e: "http://somesite.com/some/page?arg1=foo&arg2=bar
"http://somesite.com/some/page?arg1=bar&arg2=foo
(are they two separate pages? or just arguments sent to the page from which some logic is displayed).
That is why they created, and support the <link rel="canonical"> stuff. And why it is built into all CMSMS standard templates. With that tag you can TELL the search engines what the one true URL is, regardless of the path that was used to get there, or the arguments added to the path.
a: CMSMS supports accessing a page from many different URLS
"http://mysite.com/index.php?page=alias {* pretty urls turned off *}
"http://mysite.com/index.php/alias {* internal pretty urls *}
"http://mysite.com/index.php/a/url/i/ent ... ng/content {* internal pretty urls *}
"http://mysite.com/alias {* mod_rewrite *}
"http://mysite.com/some/random/path/to/alias {* mod_rewrite *}
"http://mysite.com/a/url/i/entererd/when/editing/content {* mod_rewrite *}
This is NOT a bug.
b: Search engines like google recognize the fact that there may be numerous relative paths and/or arguments attached to a page, that all point to the same URL.
i.e: "http://somesite.com/some/page?arg1=foo&arg2=bar
"http://somesite.com/some/page?arg1=bar&arg2=foo
(are they two separate pages? or just arguments sent to the page from which some logic is displayed).
That is why they created, and support the <link rel="canonical"> stuff. And why it is built into all CMSMS standard templates. With that tag you can TELL the search engines what the one true URL is, regardless of the path that was used to get there, or the arguments added to the path.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: URL hierarchy help
Thank you for your reply Calguy, I did try searching for this before posting but I obviously didn't get the search terms correct.
I understand your point, I guess I am just thinking in terms of folders. As in if you haven't put a file in a folder then you won't find it there.
As a result of you comments I am guessing there is no easy way (or standard way) to force CMSMS to use the paths I had predetermined when I added the parent and child pages to the CMS?
I understand your point, I guess I am just thinking in terms of folders. As in if you haven't put a file in a folder then you won't find it there.
As a result of you comments I am guessing there is no easy way (or standard way) to force CMSMS to use the paths I had predetermined when I added the parent and child pages to the CMS?
~ Life is like water, every movement you make changes the way it flows ~
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: URL hierarchy help
Why would you even want to 'force' one url setup?
With a flexible mechanism like CMSMS has you can move content around to different pages (it happens way more often than you think). and all of your internal links will just 'work'. This is the primary advantage of a CMS.
Additionally, your users bookmarks will continue to work even if you moved the page to a different place in the hierarchy tree... as long as you didn't change the alias.
So that search engines can find moved pages (because when you move a page the canonical URL does change), you can simply add a single line into the .htaccess or use a module like 'movedpages'.
If you specify a 'page url' when editing content then even when you move the page underneath a different parent, that doesn't change... therefore even the SEO wont be effected.
With a flexible mechanism like CMSMS has you can move content around to different pages (it happens way more often than you think). and all of your internal links will just 'work'. This is the primary advantage of a CMS.
Additionally, your users bookmarks will continue to work even if you moved the page to a different place in the hierarchy tree... as long as you didn't change the alias.
So that search engines can find moved pages (because when you move a page the canonical URL does change), you can simply add a single line into the .htaccess or use a module like 'movedpages'.
If you specify a 'page url' when editing content then even when you move the page underneath a different parent, that doesn't change... therefore even the SEO wont be effected.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: URL hierarchy help
Now I will state the obvious...
Google or any other bot doesn't guess URLs or add random stuff in front or between the url path they only follow links they find starting with the index/home page...
Google or any other bot doesn't guess URLs or add random stuff in front or between the url path they only follow links they find starting with the index/home page...