I’ve just installed Drupal 10 after many years without using it, and my first look is at the path issue, which has always been left a bit up in the air if you don’t tweak anything. I’m talking about the redirects that should ensure you always reach the same URL, and I’ve verified that this is still the case.
Problems with paths
First you have to enable clean_url, which you probably activated during installation. This removes dynamic URLs with variables, which in Drupal look like q=something.
Even so, Drupal will still show the same page on different URLs for nodes: on the one hand the node URL drupalweb.com/node/1 and on the other the clean URL you’ve given it manually or via a plugin—drupalweb.com/clean-url.
The second serious problem occurs on the home page: there are three ways to reach it—the very same front-page URL:
- drupalweb.com
- drupalweb.com/index.php
- drupalweb.com/node
A third point is that Drupal strips the trailing slash from URLs. I’m not saying that’s bad, but the usual trend is the opposite—adding a trailing slash—so it redirects us to
drupalweb.com/he-vuelto
To try to correct these issues—which can be serious for SEO because Google might detect duplicate content—I’ve tested a couple of modules.
In theory Google shouldn’t flag it as duplicate content because the canonical is set correctly, but better safe than sorry, and I think it’s important to solve this URL matter.
Pathauto module
Pathauto is an indispensable plugin in any Drupal installation, so I install it and check whether it solves the path issue—which, as expected, it doesn’t.
I install Pathauto, generate the URL patterns so it creates friendly URLs automatically, and I can still reach the same content through different URLs.
Solution with Redirect
The next step, after some Google searching, is to install Redirect. No one seems to give a clear solution, and the few answers I’ve found are more than ten years old, but this plugin gets mentioned.

Here’s the solution. In its current version the plugin ships with three sub-modules. We only need to enable one of them to fix the duplicate paths.

Once it’s enabled, make sure the option “Redirect all to their canonical” is selected.
With that, everything redirects to its canonical URL and we can forget about .htaccess
and other contraptions. Very handy.
Remaining issues
Check the redirects from www
to non-www
(or vice versa) and from http
to https
. Everything must resolve to a single version. On this site we use www
and https
, so any combination of the domain must redirect to https://www.drupalweb.com.
We’ll cover that in another tutorial.
Beware if you enable Books
Another Trojan horse I’ve battled for a long time. If you enable Books, there’s a print view that lives under the /book/
path. You don’t realize it’s there, and it often gets indexed—sometimes even ranking better than the normal content.
Same as before: although it comes (or came) with a canonical tag, you need to review it and decide whether you want to keep it, set it to noindex
, block it with robots.txt
, etc.
For now I haven’t found any other problems, but if you know of any, let me know. You wouldn’t believe how many Drupal projects out there have this unconfigured.
Comments