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
-
Links>TopPages: Mostly image URLs: Good for SEO? Redirect obsolete ones??
Looking at my "Links > Top Pages" report shows the top fifteen being image URLs (jpg files). Weird or normal? Clicking the "View Links" icon for a few of the image URL's shows that the best links in the list have DA in the 30's and 40's, and some PA in the 20's. But the linking sites have names that SOUND pretty crappy (from sites with names that sound weird or spammy) QUESTION 1: Do links to image URLs... A) help the overall SEO of the site's HTML pages, B) only help the specific page the image appears on, C) or are they of no value to the regular pages? QUESTION 2: What to do with the obsolete images? (images still hosted on our site, but do not appear on any pages) If I remove the images, the links will be lost. Which is good if the links are hurting us, but it would be bad for our SEO if the links are helping (unless we 301 the obsolete images to current ones) Thanks!
Moz Pro | | GregB1230 -
How to resolve recurring 302 redirects?
In my Moz site crawl there is a fluctuating number of 302 redirect pages that don't physically exist - most are through a 'compare product' option. The number of 302s varies significantly by how many pages Rogerbot has crawled - the more pages crawled, the higher the number of 302s, so I'm pretty sure it's the 'compare product' that's causing the issue. I can't find a way to remove the compare product button so I need another way to resolve it. I can;t canonicalise the pages as they don't exist as such. Does anyone have any ideas?
Moz Pro | | MrLeeB0 -
Page Rank vs Page and Domain Authority - who wins?
A client has found another SEO agency promising various things to do with link building. Most of these promises are based upon links from sites with allegedly high page ranks. So my questions: Page rank seems to be fading out am I safe to stay with PA and DA metrics instead? I don't agree with link building tactics and feel that it should more a networking activity to provide USEFUL links to users... am I being too white hat and missing opporunities? The other company have promised long list of links including 100 SEO friendly web directory listings, 200 PR 8 back links from Pinterest (which i thought was no follow) & 10 long lasting and high quality mini web sites (with three pages/posts, video and pictures). Am I right that this all sounds a little spammy or is this really what I should be doing for me clients?
Moz Pro | | SoundinTheory0 -
SEO Crawl Report Images?
Does SEOMOZ crawl images in the report? Raven tools is showing me about 200 missing alt tags and title tags. I can not seem to find any of this information on the SEOMOZ report. Am I missing something?
Moz Pro | | jasonsixtwo0 -
Learn SEOmoz API (and more)?
I'm sorry for this very basic question. The reason why I'm asking is that I wan't to start to use SEOmoz API (and later on Majestic SEO etc.) I have search on the web about API in general, SEOmoz specifically, in Q&A and asked around but:
Moz Pro | | OscarSE
I really can't get my head around what "set of skills" I need to know to be able use the SEOmoz API? And other APIs for that reason. Do I need a programming skills, or just knowledge how each specific API works(+ common sense)? Or both? I'm sorry if this is off topic but the main reason why I'm asking is that I wan't to start to use the SEOmoz API. If you could provide a link or two about where I can start to learn about how this works, I would really appreciate that!0 -
How to make a best SEO strategy
Hi I want to make a seo strategy for website. what things I need and how to make is there any tool?
Moz Pro | | Kabooter0 -
Sorting On-page Optimization Reports
I know there are several pre-set ways to sort the on-page optimization reports, but how can I custom sort them into my own order?
Moz Pro | | WillWatrous0 -
4xx status code a page that cannot be accessed..
All the error is because the Danish letters "åøæ" in the url.. But i can access all pages, therefor the error isent a true error!!! Why is it an Issue, Google can read "øæå", why cant SEOMOZ??
Moz Pro | | seopeter290