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
-
Site has 302 redirects for HTTP to HTTPS when it should be 301
Hey all, In the latest Moz crawl, certain pages on our website have shown as having 302 redirects for the http to https, but not all. There should be a 301 solution, but wanted to see if anyone had any advice or guidance. Thanks!
On-Page Optimization | | Julzseo1 -
Word Count - Content site vs ecommerce site
Hi there, what are your thoughts on word count for a content site vs. an ecommerce site. A lot of content sites have no problem pushing out 500+ words per page, which for me is a decent amount to help you get traction. However on ecommerce sites, a lot of the time the product description only needs to be sub-100 words and the total word count on the page comes in at under 300 words, a lot of that could be considered duplicate. So what are your views? Do ecommerce sites still need to have a high word count on the product description page to rank better?
On-Page Optimization | | Bee1590 -
Cornerstone Page And Outbound Links
I have a cornerstone page and 10 related articles that all have links to the cornerstone page. My question is, should the cornerstone page link back to those 10 articles as well or will it lose juice by doing so? Thanks in advance 😉
On-Page Optimization | | Humanovation0 -
Header Links vs. In Page Links
We have lost considerable rank for some of our top search terms (department names) and the rank loss correlates to a change we made on our homepage. That change was to remove a secondary navigation to the major departments in the content of our homepage. Now all we have is the global header navigation on the homepage (and all other pages on the site). I have read that in-page links pass more value than sitewide header links and I'm wondering if this is really true. These were text links (not linked images) and our header also contains text links (and some javascript). We did not make any other changes on our site at this time and this was not around the time of any major algorithm updates. The site is www.ebags.com.
On-Page Optimization | | SharieBags1 -
Removing Tag Cloud to Decrease the number of On-Site Links?
I have website which has a tag cloud at the footer. This tag cloud or tag box has about 40 links pointing to different words(tags) pages. I believe that the tags are hardly ever clicked on by visitors, since its at the footer. If the tag cloud is removed would this decrease the number of on-site links? According crawl diagnostics summary I have 195 pages with too many links. Would removing it help? And what kind changes can I expect if they removed (seo wise)?
On-Page Optimization | | utesters0 -
I built a website on magentogo - IrisScottPrints.com. The seomoz crawl report states 301 rel canonical crawl notices. What if anything should I change?
Wondering if I should remove "IRIS SCOTT PRINTS |" from all the title tags and/or change the url structure of the pages, to not include the breadcrumbs... I don't really understand the whole rel canonical structure thing. Also lots of errors on page title too long - does that really matter? Lots of faith in everyone here. Thanks in advance. Marcia
On-Page Optimization | | RedTrout0 -
Non-linked product short descriptions bad on ecommerce sites?
Hi, I have a question regarding SEO for ecommerce: Do you guys think it could be a bad thing to display non-linked short product descriptions of products on the home page and category pages? Can that cause cannibalism between different pages and non-optimal keyword targeting? I have a shop of which it's homepage tend to rank for some unintended phrases. Thank you, E
On-Page Optimization | | mrlolalot0 -
If I have too many on-page links can I reduce it with nofollow tags or do the links have to be removed?
On my site I have a top nav drop down menu but once visitors go to one particularly large subsection, that menu is repeated on the left for easier viewing. As a result, I shoot over 100 links on page. Can I put nofollow or noindex tags on the left side links and reduce my "official" on-page links count or do I have to actually eliminate some of the links? Thanks, Oak
On-Page Optimization | | CSA-2316710