Hi,
I've been playing around with deleting pages to test the broken link report and I am a bit surprised with the behaviour of the system in general, I hope someone can help me understand how things work with regards to internal links.
When I move a page to the trash, I get a message saying:
[quote]When "myPage" is moved to the trash, any URLs that it currently has will be broken.[/quote]
The message then let's me select an new asset to point the URLs to. Now, I assumed that this meant any internal links to that page would be automatically redirected to the new asset. Is this a correct assumption?
Currently, when i browse to a page with a link to my trashed asset, the href of the link is an unresolved asset number (e.g. <a href="/?a=229">). Even weirder clicking on it sends me to the 'supposedly trashed' asset (the url at this point is still the unresolved: /?a=229). Ok, i log back in the admin, purge the trash and come back to my page with the link. This time I get a PHP Notice saying offset 229 is an undefined asset and my link now has an empty href. In this whole thing, the new asset I told Matrix to point to was never used or even seen.
I guess to phrase a question at the end of this long post: Is this the way it's meant to behave?
Currently using version: 3.2.1 and 3.4.0RC1 both have the same behaviour. I'm assuming the notice is only due to the fact that i installed the system with medium (or high, can't remember) debug level.
Not quite. Matrix warns you that any links within Matrix will be broken if you Trash an asset.
By selecting a new asset to point URLs to, Matrix creates an entry in the Remap Manager for the old URL. This is to allow external users who may have bookmarked the page (or other pages that may have links to the trashed page) to continue working. Matrix will remap the old URL to the URL of the asset selected.
However, it will not fix internal links. It lists all the internal links on the first page of the HIPO and you should fix/remove those first.
Remapping URLs when deleting doesnt go and change all internal links - that would take far too long to do. Instead, it warns you and shows you the pages on which the links occur so can you fix them yourself first.
The reamap URL is for external sites linking to yours. If you trash a page, you may wish to redirect all links from external sites that link to the page to a new page - letting them know it moved rather than just a Page Not Found.
Yes, if the asset still has read permissions for Public. However, you may find that it has no design and no friendly URL if it was inheriting those from the site (or another asset).
Correct. Matrix will also generate an error when displaying that page (Undefined Index) which is visible if you haven't disabled Errors on the Frontend (in System Configuration).
Is there a specific reason why it isn't generating 404?
It seems to me like it would be extremely useful. At the moment on 2 browser tested, the page is refreshed and the user is left wondering. I'd much rather be directed to a nice 404 page that gives me some choices maybe even a search box.
I'm happy to put it in the bug tracker as a feature request but would like to know what others think first.
You dont need to set a remap URL when you delete - its just an option. If you dont, external URLs to broken pages will then go to the site's 404 page, or to the global one set in the Remap Manager if the site does not have one set.
For URLs missing in content (internal URLs), we cant even generate a URL because the asset doesnt exist any more, so thats why those URLs dont go anywhere.
Sorry Greg, I guess my post wasn't very clear. I am happy with the way the remap URL works. My concerns are related to internal links.
If a user clicks on a link to a deleted asset and the page you are currently on is refreshed (which is the current behaviour), it is highly unlikely that they will understand what is going on. Users are going to be much more upset (and likely to click on the link again) than if they were directed to a 404 Page not found.
I guess if Matrix cant generate a URL, then a "404-reserved URL" should be put in the link. Don't know if it is easy to do or not.