Bad code on Learn Seo Redirection info Page
-
Is it just me, or is the Redirection resource page missing the exclamation point (!) in this code. If so, this could really mess someone's site up if they copy and paste.
http://www.seomoz.org/learn-seo/redirection
http://screencast.com/t/n7lknZ32G9xF
Redirecting Canonical Hostnames: The original developers at SEOmoz needed to redirect any requests that do not start with www.seomoz.org to make sure they included the www. They did this not only because it looks better, but to avoid common canonicalization errors. Redirect: http://seomoz.org/To: http://www.seomoz.org/ Redirect: http://mail.seomoz.org/To: http://www.seomoz.org Redirect: http://seomoz.org/somefile.phpTo: http://www.seomoz.org/somefile.php Solution: Add the following directive: RewriteCond %{HTTP_HOST} ^seomoz.org [NC]RewriteRule (.*) http://www.seomoz.org/$1 [L,R=301] Explanation: This directive tells apache to examine the host the visitor is accessing (in this case: seomoz.org), and if it does not equal www.seomoz.org redirect to www.seomoz.org. The exclamation point (!) in front of www.seomoz.org negates the comparison, saying “if the host IS NOT www.seomoz.org, then perform RewriteRule.” In our case RewriteRule redirects them to www.seomoz.org while preserving the exact file they were accessing in a back-reference.
*emphasis added by me
-
I think I'm becoming anal retentive. Just today, I took the time to contact two "seo" companies with linked articles from the Learn Seo page to let them know that they might want to redirect their broken links! I can't imagine having a link like that and letting it just crumble in to little 1s and 0s, not to mention I didn't get the info I was wanting. I'm sure they'll think I'm nuts. I then start thinking to myself, "self, you might know a thing or two" and then another robot and his tag issue come whack me back in my place...
thanks for the confirmation Cyrus. I just found out there's a support forum for this kind of thing..probably a better place for these issues.
-
Hi Holly,
Good catch. The code should look like:
RewriteCond %{HTTP_HOST} !^www.seomoz.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R,L]Explanation:
This directive tells apache to examine the host the visitor is accessing. If it does not equal www.seomoz.org, redirect to www.seomoz.org. The exclamation point (!) in front of ^www.seomoz.org negates the comparison, saying “if the host IS NOT www.seomoz.org, then perform RewriteRule.” In our case RewriteRule redirects them to www.seomoz.org while preserving the exact file they were accessing in a back-reference.
I'll send a note to our help team to get this fixed.
Thanks!
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Why doesn't Moz crawl whole pages of our website to report All On-Page issues?
Hi friends & mozzers, How can't Moz crawl whole pages of our website: https://www.4atvtires.com/ to report All Serious On-Page issues. We have more than 15000 product pages. And how could it be possible that Moz isn't able to crawl whole, just got crawl report upto 258 pages of our website, and also I can experience the same in Google webmaster ?? Please help to fix this issue as early as possible. Regards,
Moz Pro | | BigSlate
Rann0 -
Redirects, SEO and More
Website errors remittent of Chernobyl. First of all, I ask a lot of questions of the community and I don't do a lot of answering. For that, I am sorry! I own a small SEO company and the majority of my clients are upstarts just like myself. We try to do the best we can on a very limited budget.
Moz Pro | | underdogmike
With that said, the client website in question, http://bestdefensega.com has been a struggle to rank in the metro atlanta lawyer market.
Here's the story. My client is a new solo attorney that practices criminal law and personal injury law. We launched bestdensega.com to focus on criminal defense and my client has also paid AVVO for a website as well. We recently decided to make a monster website that would have 50+ pages and be representative of all that he practices.
I recently put a temporary redirect on bestdefensega.com and pointed it to the avvo website while I was rebuilding the website. I did this using a plugin.
This morning I decided that I wanted to remove the redirect, so I deactivated and deleted the plugin. The redirect is still in effect. I suspect that this may be a cacheing scenario.
How do I undo a redirect?
Also, I noticed that the AVVO site has all of a sudden shot up to the top of the search results and bestdefnesega.com has dropped past the 3rd page for our keywords. Have I lost all of bestdefensega.com's link juice? Also, bestdefensega.com has a spam score of 7. Why? There are no shady links and everything I do is on the up and up. Also Open Site Explorer says that bestdefensega.com doesn't have any inbound links.
Google WebMaster Tools says that the site has of 500 inbound links.. Frustrated, Thanks0 -
Link Profile - What is Good or Bad?
How can I tell (using Moz tools) which links are okay or not? Looking at them, some are clearly just for rank, but are they worth my effort in removing them? And, if I remove a bunch of links suddenly, will Google penalize me? And how do I know if my link profile is to blame? My site was ranking pretty well in June and has steadily fallen around 4-5 spots across all of my keywords. Some of my competitors without as good of DA, PA and links are outranking me.
Moz Pro | | CalicoKitty20000 -
Duplicate Page content
I found these URLs in Issue: Duplicate Page Content | http://www.decoparty.fr/Products.asp?SubCatID=4612&CatID=139 1 0 10 1 http://www.decoparty.fr/Products.asp?SubCatID=4195&CatID=280 1 0 10 1 http://www.decoparty.fr/Catproducts.asp?CatID=124 | 28 | 0 | 12 | 1 |
Moz Pro | | partyrama0 -
Finding page authority for a list of sites
I went to Distilled's linklove conference earlier this week. Many of the presenters showed spreadsheets where they had pulled in Page Authority for a long list of sites. What tool can you use to quickly do this? For instance, I want to be able to copy a list of 100 sites into a tool and have it spit out the PA for every site...anybody know how to do this?
Moz Pro | | znotes0 -
Status 404-pages
Hi all, One of my websites has been crawled by SEOmoz this week. The crawl showed me 3 errors: 1 missing title and 2 client errors (4XX). One of these client errors is the 404-page itself! What's your suggestion about this error? Should a 404-page have the 404 http status? I'd like to hear your opinion about this one! Thanks all!
Moz Pro | | Partouter0 -
SEOMoz only crawling 5 pages of my website
Hello, I've added a new website to my SEOmoz campaign tool. It only crawls 5 pages of the site. I know the site has way more pages then this and also has a blog. Google shows at least 1000 results indexed. Am I doing something wrong? Could it be that the site is preventing a proper crawl? Thanks Bill
Moz Pro | | wparlaman0