Experimental project
This is a sandbox project, which contains experimental code for developer use only.
Suri (Strict URI) is an attempt to reduce "duplicate content" on websites.
The concern
Let's suppose you wrote you code and defined a menu 'mymodule/%' which has as occurence 'mymodule/example'.
The way drupal works make 'mymodule/example' and 'mymodule/example/test' to be treated by the same 'page callback'.
In some case, 'mymodule/example/test' will be treated by Google as duplicate content.
There's another case where you menu doesn't deal with parameters like 'page' or 'utm' or another unwanted. For example, on most urls, we can add an extra parameters (look drupal.org/node/21951 and drupal.org/node/21951?page=12). The extra parameters in the latter case is 'page', which is not performed by the page. Thus making it unecessary.
Both example could lead to duplicate content if indexed by google.
How does suri try to resolve it ?
Each drupal menu has a fixed number parts. When a url is given and if the max parts of the path is more than what is defined in the menu, then Suri try to guess the nearer parent and redirect the user to it.
If a menu is configured to accept only specific arguments, anytime the menu will be called with unwanted argument, the user will be redirect to the nearer parent of the menu.
How can you specify which extra arguments you deal with ?
Extra arguments can be defined when building a menu, through the hook_menu.
A new key Suri arguments can be the same way page arguments is given.
If you're not an administrator, you can specify arguments for every menu drupal through 'admin/settings/suri/urls'.
How can you test it ?
A simple test can be done as follow:
Take any node you have and hit this 'node/xxx/testus' (where xxx is your node id).
Next
A more finished description is to come.
Project information
- Project categories: Site structure
- Created by wilmar81 on , updated