Redirecting broken urls

Discuss Search Engine Optimization in relation to Joomla! 2.5. This forum will also have discussions on SEF/SEO Joomla! 2.5 extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
Peppers
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Fri Apr 06, 2012 2:54 pm

Redirecting broken urls

Post by Peppers » Wed Dec 12, 2012 9:41 pm

Hi, Google finds several broken urls on my site when sef is on. For examle these:

http://example.com/component/contact/6?Itemid=73
http://example.com/component/contact/6?Itemid=96
http://example.com/component/contact/6?Itemid=31

Can I and/or how do I make a redirect in my .htaccess file to redirect any and all similar urls to:

http://example.com/component/contact/

Thanks

User avatar
dynamictemplate
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Thu Dec 13, 2012 2:44 pm
Location: US
Contact:

Re: Redirecting broken urls

Post by dynamictemplate » Thu Dec 13, 2012 3:14 pm

if you need simple redirection write this
redirect component/contact/6?Itemid=73 component/contact/

first is what and second is where

User avatar
dynamictemplate
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Thu Dec 13, 2012 2:44 pm
Location: US
Contact:

Re: Redirecting broken urls

Post by dynamictemplate » Thu Dec 13, 2012 3:17 pm

if you need with different vars try this

RewriteCond %{REQUEST_URI} /index.php
RewriteCond %{QUERY_STRING} manufacturers_id=Flash%20template [NC]
RewriteRule ^.*$ /type/flash-templates? [R=301,L]

redirect

/index.php?manufacturers_id=Flash%20template

to

/type/flash-templates

Peppers
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Fri Apr 06, 2012 2:54 pm

Re: Redirecting broken urls

Post by Peppers » Thu Dec 13, 2012 9:15 pm

Thank You dynamictemplate.

That was exactly what I was looking for. It was cute that you didn't make it too easy for me by using my example in your second reply, but I do understand how it would work with my example.

Since posting, I discovered this other post http://forum.joomla.org/viewtopic.php?f ... 4&start=30 That seems to be addressing the root of what is causing my problems. Between your solution and what they suggested, I should be able to solve my problems. I may find out in the next day or two.

Thanks

Peppers
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Fri Apr 06, 2012 2:54 pm

Re: Redirecting broken urls

Post by Peppers » Tue Dec 25, 2012 2:31 pm

Resolved!

With the help of "datatrond" in another post, and Screaming Frog SEO Spider http://www.screamingfrog.co.uk/seo-spider/, I discovered what was generating my broken links. There is a (template?) link to /component/contact in the "written by" text in all of my articles. That little thing in the bar at the top of all my articles that I've never paid much attention to. I didn't even realize there was a link imbedded in it.

I always use an alias for author instead of "administrator". That "written by" link is broken because it needs to be pointed to a contact in my contact list. My alias didn't have a contact. I just needed to create a contact for that alias so that the link had a contact to point to.

I still don't understand why the broken urls were only generated when sef was set to on, but my site is working properly now. I'm so grateful for everybody's help on this.

EdoRo
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Wed Feb 15, 2012 3:25 pm

Re: Redirecting broken urls

Post by EdoRo » Wed Dec 26, 2012 12:16 pm

Hello,
Any suggestion on how to redirect website.org/home/article to website.org/article

This is working in my .httacces file
RewriteCond %{HTTP_HOST} ^website\.org$ [OR]
RewriteCond %{HTTP_HOST} ^www\.website\.org$
RewriteRule ^index\.php\/article$ "http\:\/\/website\.org\/article" [R=301,L]

This is not working
RewriteCond %{HTTP_HOST} ^website\.org$ [OR]
RewriteCond %{HTTP_HOST} ^www\.website\.org$
RewriteRule ^home\/article$ "http\:\/\/website\.org\/article" [R=301,L]

Thank you:)

User avatar
lrb
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Thu Dec 27, 2012 2:56 pm
Location: London, UK
Contact:

Re: Redirecting broken urls

Post by lrb » Thu Dec 27, 2012 3:20 pm

It's worth noting unless you have links going to those pages a redirect is not recommended. Google now prefers 404's if the page doesn't exist and 301's when you are redirecting a page that had juice and you want to retain the juice to the new url. Due to the amount of people abusing 301's it is in most peoples intrest to start using 404's over 301's and only ever use 301's when its designed too.

EdoRo
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Wed Feb 15, 2012 3:25 pm

Re: Redirecting broken urls

Post by EdoRo » Thu Dec 27, 2012 3:54 pm

Thank you, I guess this is the case here, because this is a valid link.
Google has found this alternate links, and I want them to point to the same address.
Thank you.

benforce
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Mon Dec 24, 2012 1:39 pm

Re: Redirecting broken urls

Post by benforce » Fri Dec 28, 2012 2:11 pm

dynamictemplate wrote:if you need with different vars try this

RewriteCond %{REQUEST_URI} /index.php
RewriteCond %{QUERY_STRING} manufacturers_id=Flash%20template [NC]
RewriteRule ^.*$ /type/flash-templates? [R=301,L]

redirect

/index.php?manufacturers_id=Flash%20template

to

/type/flash-templates

thanks a bunch man helped a lot
Last edited by benforce on Fri Dec 28, 2012 2:59 pm, edited 2 times in total.

User avatar
lrb
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Thu Dec 27, 2012 2:56 pm
Location: London, UK
Contact:

Re: Redirecting broken urls

Post by lrb » Fri Dec 28, 2012 2:37 pm

EdoRo wrote:Thank you, I guess this is the case here, because this is a valid link.
Google has found this alternate links, and I want them to point to the same address.
Thank you.
Alternative Links are fine and so are duplicate pages, its about telling Google what the master pages are, that way they won't even bother indexing the additional pages that are accessible. So all these pages that you are seeing in your index it is because you haven't be using Rel Canonical within your pages, Had you been doing so they would of never made it into Googles indexing.

I strongly recommend you start using Rel Canonical over mass redirects, Simply install a SEO component like SH404SEF or AceSEF and let them handle what the master pages are, then simplely remove all the duplicate pages using Googles webmasters tools. Simples.


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 2.5”