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
-
301 Redirect to external site
Hi guys, We have a client who is getting their website redesigned through us. They are discontinuing couple of their services which will not get featured in the new site. They are fairly well ranked for these services and my client wishes to 301 redirect these pages to an external site owned by his friend so that they benefit out of the ranking. The question is: Will my client's website's general ranking get affected due to 301 redirecting to an external site? The external site is not spammy or red-flagged by Google (at the moment, at least). Thanks in advance!
On-Page Optimization | | RameshNair
Ramesh Nair0 -
Changing site title
I'm wondering what the procedure and implications are of changing my sites tile? I realise that my Having my keyword in my sites title whilst chasing the same keyword in articles may be causing over optimization. The slug also takes on the article title too, in effect giving me the keyword three times before I've even written my article. Example below. Imaginary site title : soap benefits.org Article: The essential guide to making homemade soap Slug: The-essential-guide-to-making-homemade-soap As you can see, soap has now been mentioned three times, not including excerpt/meta description or image alt tags. As most of the article titles would contain my supposed keyword "soap" I'm thinking the best option would be to change site title with allinoneseo (that possible?) and change the slug to something relevant, giving me more room to escape over optimization. Does this sound sensible? I don't have that many articles so if I had to change other things it wouldn't be too much of a hassle. It seems a pity to loose my sites title I picked, but if I end up writing hundreds of articles this would be a problem. Help appreciated.
On-Page Optimization | | marangus0 -
Too Many On-Page Links
Ok so I am very new to MOZ, and we have just set up our PRO account and campaign. When we got our crawl results we had 4 pages with "too many on-page links". All of these pages correspond with our blog, which is a wordpress hosted blog that is integrated into our site. Our site is www.moxicopy.com and the blog is www.moxicopy.com/blog I am confused on how we have over 100 on page links on these pages, as we have very few links on our blog.
On-Page Optimization | | Moxicopy.com0 -
Why is this site 1st in Google??
Hello The site www.woodensigns.net is 1st in google for the keyword "wooden Signs". All seo indicators are poor except keyword in url; wich, i thought, was not a + for google anymore. Could someone help me to understand here? Thank you Emmanuel
On-Page Optimization | | manu450 -
Need help ranking my site
Hi, Can anyone help me out? I am trying to get this site ranked for "Villa General Belgrano". It was on the first page of Google and then it disappeared. Did I over optimize the anchor text? http://www.opensiteexplorer.org/anchors?site=www.lawebdelvalle.com.ar
On-Page Optimization | | Carla_Dawson0 -
Internal Linking
I am trying to figure out internal linking. Please help me. Your "root domain" (the top level example.com) is the easiest to rank on a SERP. When you build Page Rank on this page, you want to make sure the majority of the PR goes into internal pages that matter. To do this you determine what internal pages are most important and put them on the menu bar. You then link to these pages in the body text, or via side bars. This will ensure that the PR is flowing from the root domain into the internal pages multiple times. The second part is to link from these secondary pages back to the main page. Correct? When you build back links on the internal page, you want to pass the PR back to the main page... Please discuss this...
On-Page Optimization | | JML11790 -
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 -
No Follow Internal Links
Hi Mozzers, I know that this has been asked a few times and answered as well, I would just like to know some more on the internal link count on a page. I ran the SEOmoz report and many of the pages on the website have more than 150+ internal links. Now, should I use the rel=nofollow tag on some pages that I feel are not important? I have a list of pages which are not important from the SEO point of view, but from the usability factors they need to be there so I cannot remove the links to them. So, would be OK to place the rel=nofollow tag on them. My whole purpose is to reduce the count of internal links on the page as seen by SE's. Now, some say that the rel=nofollow tag does not lower the link count, but it can definitely (I believe) prevent the bots time in getting to those pages, which SEOmoz report also quotes. (__When search engine spiders crawl the Internet they are limited by technology resources and are only able to crawl a certain number of links per webpage. ) So, probably I can save their time. Does anyone have any views on this, Cheers,
On-Page Optimization | | RanjeetP0