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
-
301 Redirects - But still duplicate content?
Our website domain website.com redirects to website.com/en (since it's in English). Therefore, all pages on website.com redirects to website.com/en. In my Moz analytics, it says I have duplicate content, and lists all of these pages. Didn't the 301 redirects take care of the duplicate content? Or do I still have to add canonical tags?
Moz Pro | | Taulia0 -
How To Confidently Start SEOing?
Hi Guys, Im a Web developer (Front end and back end). Ive been learning SEO tips and tricks for the last 2 years but didn't have courage to apply them to any of my clients because of lack of confidence. I say lack of confidence because I never had a SEO Guru teaching me the "Proper" way to do SEO and see ranks change OR how to really take the first step when it comes to a SEO Project, so I didnt know how to even see if my work is paying off. Now I got this client who is a Vehicle Importer in Melbourne, and he imports cars from Japan. Im charging him $200/month for 12 months to improve SEO and cut down his competition and get his site on Google. But I have no idea where to start. His site has a blog setup already and its pretty good structure wise. I have done the On page optimizations and sitemaps etc etc, but not sure what to do next like to build links ?? or do off page optimizations, or do keyword research or really get the site on Google without any bull****?? Can you guys please please show me how to start a SEO project and how to actually use the new Moz to his best use? Thanks a lot for helping me. Regards
Moz Pro | | JazzJack0 -
Open Site Explorer is showing "No Data" for my page titles under the "Top Pages" Tab
This is for my site: www.kibin.com/ Does this mean there is something wrong with how we're titling our pages? We're working on our on-page SEO, titles, meta descriptions this week and getting them up to snuff. I don't understand what is going on here or if it's something to be worried about. Thanks!
Moz Pro | | Kibin0 -
Domain redirection www or without
when i start campain for the first time it says " "Roger has detected a problem: We have detected that the domain www.xxxxxxtour.com and the domain xxxxxxtour.****.com both respond to web requests and do not redirect. Having two "twin" domains that both resolve forces them to battle for SERP positions, making your SEO efforts less effective. We suggest redirecting one, then entering the other here." How to resolve this and how can i redirect xxxxxxtour..com to www.xxxxxxtour.com ? Thank you
Moz Pro | | innofidelity0 -
Wrong duplicated page content
I found out that some errors on my website are considered as "duplicated page content" while they are not, the content is different on each page. I wonder why ? Is it an issue from Seomoz ?
Moz Pro | | Amadeus_eBC0 -
Seo affordable company
Hi, my website is www.theprinterdepo.com We want to hire a seo company that does everything together and can help me to increase visitors. I am a truly believer that SEO is the best way to improve sales, we did seo in the past but my boss only liked to do it for 6 months, so we went from 8,000 visits to 25,000 visits in 6 months, but after stopping the contract, visits went down again. Sales also increased and decreased in the same way during that time. I need a SEO Company which I can afford for a long term projec and that can help me beat my competitors in my niche. (printers, printer accesories, printer parts, printer toners, etc), 70% of our items are refurbished, but we also sell new ones pretty well. So ranking for the keyword refurbished printers only is not enough. We have about 12,000 visits per month and our goal is to go to 25,000 in 3 months, 50,000 in 6 months, and 100,000 in one year. I think this is pretty doable, do you? I wonder if someone in the forum can recommend me one good seo company that can give us a full integrated seo solution/quote, and that we can afford. I would be welcome to hire maybe seos that are starting their own company if there is proven success or something, sometimes big company names charge a lot.
Moz Pro | | levalencia10 -
On Page Optimization Reports - Huh?
I've been working hard to use this EXCELLENT tool for optimize some of what I consider my most important pages . . . But the automatic tool that pulls pages and grades them (the "summary" of the "on page" report) . . . I don't get it. It only graded three of my pages, and I don't understand how it chose what keywords to grade it for? I'm just very confused. I don't understand how it chose the pages to grade, not the words it chose to grade it against. 😞
Moz Pro | | damon12120 -
302 Redirects on Xcart Store
The crawl finished on the site easydecals.com and I'm getting over 4,000 warnings with 302 redirects with urls like this. /How-To-Install-A-Wall-Decal.html?xid_33e42=01f75b1ca2a53108d78f5c598ffd99e6 What can I do to remove or stop the spider from hitting those?
Moz Pro | | i1560