Global Redirect - A Solution To A Problem You Didn't Know You Had?

(Submitted Sun, 2006-10-08 00:20)

Nicholas Thompson has just committed a new module called Global Redirect.

Essentially, the module checks to see if a given node url has been assigned an alias, and if so, uses a permanent redirect to that alias. Currently if you are using url aliasing - say through the path_auto module - you are left with the old numberic url ("node/1234") and the new aliased url. You therefore risk being punished by Uncle Google for serving duplicate content.

Submitted by Ephram Zerb (not verified) on Sun, 2006-10-08 04:28.

Definatly going to check that one out. If only there was a solution for the forwad-slash problem.

Submitted by drawk on Sun, 2006-10-08 06:21.

I wonder if extending this module might be a good way to solve that problem.

Do I understand correctly that the logic would need to be:

1) Check if the user is viewing a node
2) If so, check if the url has a trailing slash
3) If it doesn't have a trailing slash, send a 301 redirect to the same url with a trailing slash appended

?

It shouldn't be difficult to add that to the Global Redirect module, if that's all it would take. I'd be happy to write a patch.

Submitted by nicholasThompson (not verified) on Sun, 2006-10-08 13:17.

It could probably easily be modified for that... However we'd need to definately know there are no cases where a trailing forward slash is definately needed...

Submitted by Bob Dannon (not verified) on Sun, 2007-03-04 04:29.

Hi, just popped in here through a random link. Hi, firstly I'd like to say your site is great and very impressive. Enjoyed the reading.

Submitted by drawk on Sun, 2006-10-08 15:20.

Maybe it should be an option that can be enabled/disabled through a settings page, with the default set to disabled.

That way, it can be off except for people that want to test it out. If there appear to be situations where it is causing problems in some setups, one solution might be a textarea on the settings page where site admins can list urls that shouldn't be tampered with ... similar to how block visibility is handled.

Submitted by dizi izle (not verified) on Fri, 2009-01-30 14:31.

thanx for your writing to post, I like your web site and good lucky. Regards.

Submitted by nicholasThompson (not verified) on Sun, 2006-10-08 16:08.

Possibly - however could this also not be achieved by a nifty piece of Apache redirecting magic (as hyrcan says in his post in the above quoted thread - http://drupal.org/node/83630#comment-154568)

Submitted by internet marketing services (not verified) on Wed, 2009-05-20 21:16.

You could also use PHP's header or redirect function, or better, just work on it through Javascript.

Submitted by drawk on Mon, 2006-10-09 01:05.

I can see the argument for both. The major benefit I'd see from doing it from within Drupal is that - unlike with Apache rewrite rules - you have access to some handy information such as whether the user is viewing a node. The problem that hyrcan ran into re: the login system would be circumvented. As would a whole host of others that would take individual rewrites to deal with, because the information you need just can't be parsed from the url. Plus htaccess modifications are pretty esoteric to a lot of people who are perfectly comfortable installing a contrib module.

BUT -- I think this may all be moot, anyways. Moshe is prompting you to submit your module code as a patch against core. http://drupal.org/node/88146

:)

Submitted by Ephram Zerb (not verified) on Wed, 2006-10-11 10:06.

Taking hyrcan's advice, we've added the proper rewrite rules and are set to push the website to production (we'll see if anything else comes up). After some testing, the decision was made for /node, /admin, and /user not to be effected by the rewrite rules I remember not being able to change some settings if /admin wasn't excluded, while /node was excluded due to some (potentially unrelated) file upload issues and as a just-in-case measure.

In the process of implementing the rewrites, the conf file was tweaked and re-ordered a couple of times due to conflicts with other rewrite directives. Perhaps further proof that it might make more sense to do it on the Drupal level.

As for the logic behind how it should work -- if the path appears to be a file name (i.e. .html), no forward slash should be appended. Otherwise, if it appears to be a directory - it should be treated in the same way Apache treats a directory accessed without a forward slash: it does a 301 redirect.

Submitted by blamcast (not verified) on Mon, 2007-04-09 17:54.

There's an alternative to using Global Redirect, if you'd rather control things manually. Take a look at my Drupal SEO article, I've got some tips on using .htaccess and robots.txt to achieve similar results without the need for a new module.

Submitted by allegra (not verified) on Wed, 2007-10-31 21:45.

nice article, thanks for sharing!

Submitted by man boobs (not verified) on Sun, 2008-04-06 06:47.

Why not just remove the alias instead of all this redirecting? i think i must be missing something. Nice Drupal theme though.

Submitted by Avdhesh (not verified) on Mon, 2008-12-08 10:07.

Got a lot of advice on solving redirection problems here, thank you.

Submitted by ForexMan (not verified) on Thu, 2008-12-25 07:18.

I also believe that such a module is not necessary. Diverting easily achieved file .htaccess

Submitted by Osteopathie Berlin (not verified) on Sun, 2009-01-18 17:49.

It is great popping in that blog which is a quite old one. But it is good collecting some experiences for better understanding.

Submitted by 3freester (not verified) on Sun, 2009-02-15 19:36.

You therefore risk being punished by Uncle Google for serving duplicate content.

3freester

Submitted by Alternative music (not verified) on Sat, 2009-02-28 20:28.

Thanks for the tutorial, it is very helpful.

Submitted by eve isk (not verified) on Wed, 2009-03-18 10:15.

thanks !

Submitted by Anonymous (not verified) on Sun, 2009-03-22 17:25.

منتديات
توبيكات جديدة وحصريه
ومريت على قسم كول فيه صور
ماسنجر
و رموز ماسنجر
وحتى خلفيات ماسنجر
و ثيمات ماسنجر
موجوده وللي يحبون الكوره فيه
تغطيات رياضية وفيه
اخبار رياضية وعجبني
بعد قسم الرسائل فيه رسائل
كول و برامج للجوال و
ثيمات للجوال و
العاب للجوال كلها
حصلتها واممممم بالنسبة للبنات حدث ولاحرج فيه
فساتين خفق و
ازياء جديدة لافضل
المصممين و ديكور
للمنزل و اطباق و
حلويات وقسم عن صحة
الانسان
وجمال الجسم و
العناية بالبشره
وللي يحبون الخواطر والشعر فيه
خواطر حزينه وخواطر
شوق تعبجكم و قصص للي
يحبون القصص والاقسام الترفيهه قسم الصور مميز
صور روعه واغلبها صور
جديدة وغريبة ومضحكة وللبنوتات الصغار فيه
العاب طبعا
العاب بنات يحبها
قلبكم نجي للتصميم وعشاق الفوتوشوب فيه
صور للتصميم و
فلاتر و
فرش تحبها قلوبكم و
برامج حماية و
بلوتوث جديد واللي
يحبون الاناشيد فيه اناشيد
اطفال واسلامية جديدة نجي لأهم شي
سيرة الرسول صلى الله
عليه وسلم وسيرة الصحابة
و اذكار وادية
موجوده الله ينفعنا بها وبس

Submitted by Music (not verified) on Tue, 2009-03-24 08:57.

nice post..thanks

Submitted by Computer Howto (not verified) on Thu, 2009-04-23 10:34.

Thanks for sharing that. This is a nice Drupal Application but is accompanied by its own set of cons.

Submitted by Unblock Facebook (not verified) on Thu, 2009-04-23 20:13.

Perhaps further proof that it might make more sense to do it on the Drupal level.In the process of implementing the rewrites, the conf file was tweaked and re-ordered a couple of times due to conflicts with other rewrite directives.

Submitted by Astronomy Club (not verified) on Mon, 2009-04-27 09:42.

alright. Thanks for the instruction. But is that going to make the task easier? Anyways keep posting this warning like information oftenly.

Submitted by Fertility (not verified) on Tue, 2009-04-28 09:59.

the title of this most is mosr appropriate. I would like to thank you for drawing our attention towards this important issue.

Submitted by Twitter Apps (not verified) on Wed, 2009-04-29 18:57.

Perhaps further proof that it might make more sense to do it on the Drupal level.In the process of implementing the rewrites, the conf file was tweaked and re-ordered a couple of times due to conflicts with other rewrite directives.

Submitted by Anonymous (not verified) on Thu, 2009-05-07 01:46.
Submitted by Latest wallpapers (not verified) on Fri, 2009-05-08 18:46.

("node/1234") the remote computer did not respond in the timimg manner, first solve this problem then go to find the soloution for how to enter in "node alias ",thats give a relief fromthat big loozy problem ,i think ?

Submitted by Las Vegas Internet Marketing (not verified) on Sat, 2009-05-09 09:44.

Good suggestion.

Thanks for sharing.

Submitted by car hire dublin airport (not verified) on Mon, 2009-05-11 16:25.

finding a solution is just like " to find a coin in ma pond" now in your this article%

Submitted by jordan shoes (not verified) on Wed, 2009-05-13 10:43.

A pair of jordan shoes or ugg boots? I think you prefer air jordan shoes cos a pair of basketball shoes can help you much in the match. However, someone may saying like this: hey, give me some

Submitted by my chemical romance (not verified) on Mon, 2009-05-25 15:48.

Hi!

Submitted by my chemical romance (not verified) on Mon, 2009-05-25 15:49.

Hi!
nice post!

Submitted by ravisingh (not verified) on Tue, 2009-05-26 06:32.

I recently came accross your website. Its my first time at your site and I enjoyed reading your post. I thought I would leave my first comment. I dont know what to say except that I have enjoyed reading. This is a really great site with alot of good well written post. Thanks so much for the extra information.

Submitted by video izle (not verified) on Tue, 2009-05-26 21:17.

how can you find a solution if you don't know what's the "problem exactly",fake post this was huh! i said sorry for you

Submitted by over 40 dating (not verified) on Tue, 2009-06-16 18:07.

Hello! Good post there :) cheers

Submitted by sulumits retsambew (not verified) on Wed, 2009-06-17 08:51.

interesting article thanks for sharing.

Submitted by Problema (not verified) on Thu, 2009-06-18 16:11.

Uncle Google is always right! :D

Submitted by car rental uk (not verified) on Thu, 2009-07-09 21:26.

Man, if only there were an easy solution to duplicate content!

Hosted By Dreamhost.com