Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I just installed last(new) yet uploaded Redirect module located here https://ftp.drupal.org/files/projects/redirect-8.x-1.0-alpha1.tar.gz
As you can see i configured it to redirect non clean urls to clean ones. I also already have configured my aliases and they are working pretty fine in my lmultilanguage site.
I'm using the last drupal stable 8.0.6 version.
It seems all ok, but if i surf to node/28 my dirty url is not redirected but is shown.
I'm doing something wrong here? Please help.
Comment | File | Size | Author |
---|---|---|---|
redirect.png | 74.67 KB | Matteo Tanca | |
alias.png | 13.81 KB | Matteo Tanca |
Comments
Comment #2
Matteo Tanca CreditAttribution: Matteo Tanca commentedComment #3
Matteo Tanca CreditAttribution: Matteo Tanca commentedI reinstalled it and now is working for non clean to clean redirects. Thanks
Comment #4
Matteo Tanca CreditAttribution: Matteo Tanca commentedComment #5
kitikonti CreditAttribution: kitikonti commentedOnly as notice. I got the same problem an the same solution worked. In my case this was not a problem but on a big live site you have to delete all existing redirects to do this, which can be a problem.
Comment #6
kitikonti CreditAttribution: kitikonti commentedOk i was a little bit too fast. The solution only worked on my dev environment not on my live site. Tried clearing cache, reenable module, enable/disable single function, but nothing worked.
Comment #7
caspervoogt CreditAttribution: caspervoogt at Plethora commentedfor me it only works with 'Redirect from non-canonical URLs to the canonical URLs.' enabled. However, I do not wish to enable this because I have some pages that are indeed aliases and should NOT be redirected. So I have lots of pages showing as /node/123 and not redirecting to their pretty URL.
Comment #8
BerdirDon't really understand the last comment. Might be another duplicate of #2704213: "Redirect from non-canonical URLs to the canonical URLs" not working with language code in url, try the patch there to see if it solves your problem.
Comment #9
BerdirComment #10
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedI am not sure, I have the same problem as the original poster, but let's see:
I have enabled:
Redirect from non-canonical URLs to the canonical URLs.
and
Set Content Location Header
I have not enabled
Enforce clean and canonical URLs.
because I do not want the urls to be cleaned.
I do not get a redirect from node/1234 to its alias (or elsewhere) (ie no Location header in the http response).
I also do not get a content-location header in the HTTP response header either.
In fact, it seems to me as if there is no code corresponding to the two selected options.
Comment #11
Phil Wolstenholme CreditAttribution: Phil Wolstenholme at CTI Digital commentedIf you've used previous versions of the module and have their config files hanging around then you may need to delete some old config options from the file. See https://www.drupal.org/node/2861578 where I had a similar issue.
Comment #12
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedThanks, Phil,
my config file is
canonical: true
auto_redirect: true
default_status_code: 301
passthrough_querystring: true
warning: false
ignore_admin_path: false
access_check: false
content_location_header: false
langcode: de
route_normalizer_enabled: true
so I think it is ok.
I would like to change route_normalizer_enabled to false and content_location_header to true, but keep canonical on and actually have redirects.
Comment #13
bkosborneI just scanned the code and I don't think "Redirect from non-canonical URLs to the canonical URLs." does anything at all. That may be the issue. Will open a separate bug report.
Comment #14
bkosborneComment #15
BerdirThanks, yes that option in the UI must be a leftover that we forgot to remove.
We unified the various different settings into a single unified feature because that's what core plans to do.
The original report here is a year old and no longer relevant, closing as a duplicate of the other related issues.