Is there a module for Drupal that would allow me to perform redirects based on parts of the URL?
For example, if the URL contains this-string-to-redirect, e.g. example.com/this-string-to-redirect/node/content, then redirect to another path.
|
If you want to do this yourself, quick and dirty, it would be something like this:
You might also want/need to throw in a weight of -1 to make sure your module runs early by putting:
in yourmodule.install but a quick look just now shows globalredirect's weight at the default of 0 so this may be unneeded. |
||||
|
|
If the Path Redirect module (whose Drupal 7 version is the Redirect module) doesn't help you, it might be worth taking a look at Global Redirect as well.
|
||||
|
RedirectMatch 301 path-to-redirect(.*) new-path/$1if the rest of the path is identical – Jimajamma Apr 4 '12 at 19:32