Site wide 301 or canonical links.
-
Hi guys, I'd like add code to my header file to specify www. as opposed to just http:// for the canonical links across my entire site. How can I do this? I'd like it to be site wide code that I can just add to my header.php file which is included across the site.
-
Thanks Shane,
That was exactly what I was looking for!
-
Hi,
I believe what you are looking for is
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
If I read the post correctly as adding a sitewide canonical in header.php would not work, unless you actually programmed a php statement that all it did was add www, but this would only be a backup, if I was unable to do 301 in my opinion
Shane
-
Sorry I should have added I don't know the symbols to use to equate to any page starting with http:// should be fwd'ed to same page but http://www.
-
Hi Lodovico, thanks for your reply. I am fine with that, but do you know how I'd have to write the 301 in my .htaccess file to 301 every http://xxxxx.com page to http://www.xxxxx.com ?
-
Since the result you want is site wide, I would use a 301 redirect.
It's more radical, but you won't depend on the right header file to be included in all pages (i.e. you will be able to use different files, if you ever need it - e.g. to set up a landing page or mini site with its own template).
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
-
Will adding canonical affect traffic to the non canonical page?
We have three URLs that have the same content but all three are getting traffic.
On-Page Optimization | | NanditaKraman1 -
Reducing number of site pages?
Hi, I am looking through my site structure and I have a lot of pages left over from the days of article keywords. Probably 7 or 8 years ago, someone sold my husband on article key word pages. I have slowly gotten rid of a lot of them as they have fallen out out of the ranks. I would like to get rid of the rest, probably 5 or 6 pages. Will it hurt my rankings to delete pages and redirect them? My customers really like the simplicity of our site and I want to keep it that way, plus clean up flags that Moz is telling me is a problem. I think its easier to keep less pages top notch than have to worry with a lot of them. Especially since my customers aren't viewing them. Thanks in advance!
On-Page Optimization | | CalicoKitty20000 -
Too Many On-Page Links
If a page has more than 100 links, rather than splitting up the page into multiple pages, is it ok to use name="robots" content="noindex, follow" />? The page in question lists links to articles so the page itself isn't that important to appear in serps, but the articles are the helpful content pages: www.ides.com/articles/processing/injection-molding/
On-Page Optimization | | Prospector-Plastics0 -
Keyword distribution in the whole site
I've been taught during a SEO course that the whole site has to contain the chosen keywords with a fixed proportion of optimized pages, that should be like this: 50% of pages optimized on the most relevant keyword (just one keyword) 25% of pages optimized on secondary kewords (depending on the size of the site, could be a few pages for each secondary keywords) 25% of pages on long tail keywords. the teachers was a very respected SEO professional, but I've never seen this strategy anywhere in other articles or SEO guides. what do you think about it?
On-Page Optimization | | DavideM
It's true that it brings visibility for the top keyword?
does it lead to cannibalization?
what others strategy do you use?0 -
Canonical
http://www.providenceelectricnc.com/monroe-electrician-nc Shows great in on Page Report Card for Appropriate Use of Rel Canonical No More Than One Canonical URL Tag Then POW Canonical URL Tag Usage .... it says there is none ....?? HUH ? Searched forum but it is not discussed . Thanks !
On-Page Optimization | | SEOJunkie670 -
Do anchor links pointing to bottom/top of page count as link?
As the title says: Do anchor links pointing to bottom/top of page count as link? This page: http://www.betxpert.com/forum/bookmakere/vis/ladbrokes-kommentar I has over 300 links, but I don't see that many links. Is it the "#15" and the top/bottom of page anchors that count? Is this harmful in terms of link juice? -Rasmus
On-Page Optimization | | rasmusbang0 -
Too many on page links
I'm having trouble interpreting this data. It says several of my blog pages have too many on page links, some as high as 140 and there is no example of a blog post that they are referring to. What am I missing? I never post more than a handful (5-7) in our 600-1000wd blogs. When I drill down, it doesn't give me very much information except "Found over 41 years ago" off to the right. When I click on the "too many on page links" URL, it provides a long list of website pages that are renamed with the blog name. huh? A lot of this stuff isn't very intuitive, SEOMoz.
On-Page Optimization | | amandahx20 -
Internal link structure for large site
I am working on a very large directory site which is undergoing a complete redesign. I am considering the internal link structure from first principles. When a site has over 100,000 pages, how do you ensure that each page is linked to from somewhere so that there are no orphans? Trying to get my head around the structure makes my brain hurt. Any tips?
On-Page Optimization | | mascotmike0