Redirecting broken urls
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.
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.
-
- Joomla! Apprentice
- Posts: 18
- Joined: Fri Apr 06, 2012 2:54 pm
Redirecting broken urls
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
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
- dynamictemplate
- Joomla! Apprentice
- Posts: 32
- Joined: Thu Dec 13, 2012 2:44 pm
- Location: US
- Contact:
Re: Redirecting broken urls
if you need simple redirection write this
redirect component/contact/6?Itemid=73 component/contact/
first is what and second is where
redirect component/contact/6?Itemid=73 component/contact/
first is what and second is where
- dynamictemplate
- Joomla! Apprentice
- Posts: 32
- Joined: Thu Dec 13, 2012 2:44 pm
- Location: US
- Contact:
Re: Redirecting broken urls
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
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
-
- Joomla! Apprentice
- Posts: 18
- Joined: Fri Apr 06, 2012 2:54 pm
Re: Redirecting broken urls
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
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
-
- Joomla! Apprentice
- Posts: 18
- Joined: Fri Apr 06, 2012 2:54 pm
Re: Redirecting broken urls
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.
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.
-
- Joomla! Apprentice
- Posts: 21
- Joined: Wed Feb 15, 2012 3:25 pm
Re: Redirecting broken urls
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:)
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:)
- lrb
- Joomla! Apprentice
- Posts: 18
- Joined: Thu Dec 27, 2012 2:56 pm
- Location: London, UK
- Contact:
Re: Redirecting broken urls
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
http://www.littleredbook.net
-
- Joomla! Apprentice
- Posts: 21
- Joined: Wed Feb 15, 2012 3:25 pm
Re: Redirecting broken urls
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.
Google has found this alternate links, and I want them to point to the same address.
Thank you.
-
- Joomla! Apprentice
- Posts: 10
- Joined: Mon Dec 24, 2012 1:39 pm
Re: Redirecting broken urls
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.
- lrb
- Joomla! Apprentice
- Posts: 18
- Joined: Thu Dec 27, 2012 2:56 pm
- Location: London, UK
- Contact:
Re: Redirecting broken urls
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.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.
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
http://www.littleredbook.net