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
-
Filter Pages
Howdy Moz Forum!! I have a headache of a job over here in the UK and I'd welcome any advice! - It's sunny today, only 1 of 5 days in a year and i'm stuck on this! I have a client that currently has 22,000 pages indexed to Google with almost 4000 showing as duplicate content. The site has a "jobs" and "candidates" list. This can cause all sorts of variations such as job title, language, location etc. The filter pages all seem to be indexed. Plus the static pages are indexed. For example if there were 100 jobs at Moz being advertised, it is displaying the jobs on the following URL structure - /moz
Moz Pro | | Slumberjac
/moz/moz-jobs
/moz/moz-jobs/page/2
/moz/moz-jobs/page/3
/moz/moz-jobs/page/4
/moz/moz-jobs/page/5 ETC ETC Imagine this with some going up to page/250 I have checked GA data and can see that although there are tons of pages indexed this way, non of them past the "/moz/moz-jobs" URL get any sort of organic traffic. So, my first question! - Should I use rel-canonical tags on all the /page/2 & /page/3 etc results and point them all at the /moz/moz-jobs parent page?? The reason for this is these pages have the same title and content and fall very close to "duplicate" content even though it does pull in different jobs... I hope i'm making sense? There is also a lot of pages indexed in a way such as- https://www.examplesite.co.uk/moz-jobs/search/page/9/?candidate_search_type=seo-consulant&candidate_search_language=blank-language These are filter pages... and as far as I'm concerned shouldn't really be indexed? Second question! - Should I "no follow" everything after /page in this instance? To keep things tidy? I don't want all the variations indexed! Any help or general thoughts would be much appreciated! Thanks.0 -
Moz is treating my pages as duplicate content but the pages have different content in reality
Attached here is a screenshot of links with duplicate content. Here are some links that is also based on the screenshot http://federalland.ph/construction_updates/paseo-de-roces-as-of-october-2015 http://federalland.ph/construction_updates/sixsenses-residences-tower-2-as-of-october-2015/ http://federalland.ph/construction_updates/sixsenses-residences-tower-3-as-of-october-2015 The links that I have placed here have different content. So I don't why they are treated as duplicates BWWJuvQ
Moz Pro | | clestcruz0 -
Will Moving Categories Affect SEO
I recently designed a new website to replace an old site. We managed to hold 90% ranking and traffic by keeping the same URS's and content. Now that we have completed that we are now updating the whole site. It is an commerce website. Some of the items we were selling we are getting from a new vendor. If I move these products from one one vendor to another will this affect SEO? Here is an example. I have a product called "Green Zipper Sweater". This product is Anchored via Manufacturer and Category. The URL and Title Tag are green-zipper-sweater. If the Sweater was made by "Nike Green Sweaters" and our new supplier is "Gap Yellow and Green Sweaters". If I change the the Manufacturer and now put it under "Gap Green and Yellow Sweaters" will this affect my ranking. We are continuing to stock products from the original supplier "Nike Green Sweaters" and we have an aggressive SEO plan and are ranking very well for "Nike Green Sweaters". We also have good product ranking so "Green Zipper Sweater" brings us a lot of traffic. I want to be sure I do not loose ranking for the product page "Green Zipper Sweater" and the Brand "Nike Green Sweaters" Any advice would be appreciated.
Moz Pro | | robbieire0 -
To Worry or Not? Duplicate Content Created from Redirect After Login
One of my Moz reports is flagging duplicate content. For example, https://redchairmarket.com/Account/LogOn?ReturnUrl=%2FAccount%2FSaveSearch%3FsearchId%3D0&searchId=0 and https://redchairmarket.com/Account/LogOn?ReturnUrl=%2FAccount%2FSaveSearch%3FsearchId%3D1&searchId=1 are created when a user logs in and the website sends them back to the page they were looking at before. What is the best way to deal with this duplicate issue? How serious is it? Thank you!
Moz Pro | | BrittanyHighland0 -
How do OpensiteExplorer handle HTTPS pages?
For historical reason my entire site (https://www.banknorwegian.no ) is in )HTTPS. I am trying to use opensiteexplorer to get a linkprofile. But then I only get the links that point to www.banknorwegian.no (without https://) . Is it possible to use it for https pages? Also, I assume some of the same problem arise when I use the keyword difficulty tool. The pages I have show up in the result, but they have a Page Authority that has to be made from just links to the http version.
Moz Pro | | Peekabo0 -
SEO Moz ranking reports
I am confused. The SEO Moz ranking reports state that my site show show up in a specific position in SERP for a specific keyword yet when I google the keyword the ranking is different. Are these ranking reports merely indicative or are they supposed to be accurate?
Moz Pro | | casper4340 -
On page optimisation tool issues
When viewing my campaign and looking at the on page optimisation tool, I have a few issues. I seems to only shows the keywords I want rankings for and how optimised my homepage is for those keywords. Is there any way I can get it to analyse permanently specifc keywords for specific pages because my homepage isnt optimised for some keywords which are on my list, which I have optimised other pages for, and because its looking at my homepage its getting a really low grade, and looks really bad and frustrates me because I cant work this out. Any help greatly appreciated.
Moz Pro | | CompleteOffice1 -
How can I update On Page Optimization Reports following 301 redirect?
A few weeks ago I ran the SEOMoz On Page Optimization Reports for one of my sites. At the time, the site homepage was duplicated .com/ and .com/index.html (I know!). The On Page Optimisation Reports I ran at the time obviously included both as individual pages. I've now corrected the duplicate issue with a 301 but the On Page Optimization Reports are still looking at the rankings for .com/index.html and therefore showing "not in top 50" for keywords where I'm actually ranking 1st - any idea how I can get the reports to update so they don't continue to look for .com/index.html? Thanks!
Moz Pro | | trbaldwin0