Global Redirect Module

The Global Redirect module has three main features:

If a requested URL has a URL alias, Global Redirect will do a 301 redirect to the URL alias.
For example, if you have a URL alias for node 25 called page-title, the Global Redirect Module will do a 301 redirect from http://example.com/node/25 to http://example.com/page-title.
It will remove trailing slashes from URLs.
For example, the Global Redirect Module will redirect a request for http://example.com/page-title/ to http://example.com/page-title. If search engines spider both versions, they will see two different URLs with duplicate content.
If a requested URL is being used as Drupal's front page, it will 301 redirect to the actual front page.
For example, if you are using the path frontpage as your site's front page, a request for http://example.com/frontpage will 301 redirect to http://example.com/.

If you search around the Web for Drupal SEO tutorials, many people recommend using mod_rewrite rules in an .htaccess file to deal with issues like removing trailing slashes. But on sites that also have non-Drupal content, you may have URLs that do have trailing slashes.

A slash is the symbol for a directory. For example, in the URL http://example.com/ the trailing slash is the symbol for the root directory of example.com. If you leave the trailing slash off, the server will add it. If you request a physical directory on a Drupal site (or any site) like http://example.com/modules the server will correct you by appending the trailing slash: http://example.com/modules/. If you have non-Drupal content on your server—perhaps a WordPress blog at http://example.com/software/—you will have URLs with trailing slashes. The WordPress blog would not be located at http://example.com/software, it would be located at http://example.com/software/. You would not want to remove trailing slashes from all URLs.

That is why the Global Redirect module is a good option. It will only remove trailing slashes from URLs that are handled by Drupal.

Comments

Removing trailing slashes in maintenance mode

Just a little detail:
While in maintenance mode, removing of trailing slashes doesn't work. I have just installed global redirect module and enabled removal of trailing slashes on a site which is currently under construction, so it is in offline - maintenance mode. Then I noticed that urls with trailing slashes aren't redirected. I spent half an hour figuring out what is wrong, I even checked .htaccess few times before I tried to see if it works when I turn site into online mode. And, of course, it works.

Webmaster Tips's picture

global redirect

I'm not sure if that is a critical issue because it's unlikely Google would find URLs with trailing slashes while a site is in maintenance mode.

If the site is in maintenance mode for long periods of time (weeks) it might be better not to have it crawled during that time at all.

Not critical

That's not critical issue of course. Not at all. I posted that note just to save someone's time if bump into same situation and try to figure out what's wrong.

thanks. that was a noble

thanks. that was a noble thought for the community. one question... By default, "Menu access checking " is disabled in the Global Redirects module configuration. It sites 'to avoid any unexpected behaviour'. Can anyone please tell me what the 'unexpected behaviour' could be? and also why do i need to enable it. I mean won't the access permission be checked anyways? Thanks.

Syndicate content