Alias URL Matching Problem - Unwanted Forwarding to Canonical URL.

Hi All,

I have a problem whereby, additional text appended to the end of an alias URL in the browser is still causing a match with the alias URL and so 301 forwarding to the canonical URL, instead of just 404'ing. Example:

Canonical URL:
Alias of canonical:

Now, if I type the following into the browser, I will still be redirected to the canonical, instead of 404'd, despite the URL not matching the stated alias:

I understand that this is so one can append URL parameters to the alias, such as:

However, there doesn't seem to be a way to prevent this forwarding from happening, if it's not wanted when the URL doesn't exactly match.

I solved this by making the following adjustments to /concrete/startup/external_link.php

if (($req->getRequestCollectionPath() != '') && ($req->getRequestCollectionPath() != $c->getCollectionPath())) {
      // canonnical paths do not match requested path
      if ('/'.$req->getRequestPath() == $req->getRequestCollectionPath()) {
         header('Location: ' . Loader::helper('navigation')->getLinkToCollection($c, true), true, 301);

This way, the user will not be forwarded unless the alias URL exactly matches the requested url.

I accept that this means 'no more URL parameters' on aliases. But they currently fail work anyway ( and I don't need them either.

But... is there a better / alternative way to handle this? I realise this is a hack ;)



View Replies:
dexterweb replied on at Permalink Reply 1 Attachment
I'm facing the same issue. Any help would be welcome!

For example: this page:
should be re-directed to:
Big 404..