The Joomla! Forum ™



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.



Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Redirecting broken urls
PostPosted: Wed Dec 12, 2012 9:41 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Apr 06, 2012 2:54 pm
Posts: 18
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


Top
 Profile  
 
PostPosted: Thu Dec 13, 2012 3:14 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Dec 13, 2012 2:44 pm
Posts: 32
Location: US
if you need simple redirection write this
redirect component/contact/6?Itemid=73 component/contact/

first is what and second is where


Top
 Profile  
 
PostPosted: Thu Dec 13, 2012 3:17 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Dec 13, 2012 2:44 pm
Posts: 32
Location: US
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


Top
 Profile  
 
PostPosted: Thu Dec 13, 2012 9:15 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Apr 06, 2012 2:54 pm
Posts: 18
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=618&t=699954&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


Top
 Profile  
 
PostPosted: Tue Dec 25, 2012 2:31 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Apr 06, 2012 2:54 pm
Posts: 18
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.


Top
 Profile  
 
PostPosted: Wed Dec 26, 2012 12:16 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Feb 15, 2012 3:25 pm
Posts: 21
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:)


Top
 Profile  
 
PostPosted: Thu Dec 27, 2012 3:20 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Dec 27, 2012 2:56 pm
Posts: 18
Location: London, UK
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.

_________________
Little Red Book
http://www.littleredbook.net


Top
 Profile  
 
PostPosted: Thu Dec 27, 2012 3:54 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Feb 15, 2012 3:25 pm
Posts: 21
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.


Top
 Profile  
 
PostPosted: Fri Dec 28, 2012 2:11 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Dec 24, 2012 1:39 pm
Posts: 10
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.

Top
 Profile  
 
PostPosted: Fri Dec 28, 2012 2:37 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Dec 27, 2012 2:56 pm
Posts: 18
Location: London, UK
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.

_________________
Little Red Book
http://www.littleredbook.net


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 



Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group