Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I can use the bit.ly for shorten url in canonical?
In terms of seo, right?
for example :
<link rel="canonical" href="<?php echo $post->og('bitly'); ?>" />
and
<meta property="og:url" content="<?php echo $post->og('bitly'); ?>" />
or
<link rel="canonical" href="<?php echo $post->og('url'); ?>" />
url : http://domain/post/title
bitly: http://bit.ly/3tcJjx
Which is correct?
Thank
You cannot set the canonical URL to a shortened URL or any URL that redirects.
In many ways, Google sees a canonical as equivalent to a redirect. When you specify a canonical URL, it tells Googlebot, "Don't index the content on this URL, go here and index the content here instead." Then when Google gets to bit.ly, it finds that it redirects back and heads right back. The logic is that of an infinite redirect.
Your canonical URL must be a URL that actually contains the content. It cannot be a URL that redirects to the content.
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I have set Content-Security-Policy: default-src https:; report-uri https://rootkea.report-uri.com/r/d/csp/enforce on https://csp.rootkea.me/
Whenever I visit the website, the console says:
Content Security Policy: The page’s settings blocked the loading of a
resource at inline (“default-src”). rootkea.me:1:1
At 1:1 I have <!DOCTYPE html> as can be seen from the source:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="GitLab Pages">
<title>Plain HTML site using GitLab Pages</title>
<link rel='stylesheet' href='https://d33wubrfki0l68.cloudfront.net/css/ec5b55aee5efed4317d1380a75fc4c3df003f096/style.css'/>
</head>
<body>
<div class="navbar">
Home
Blog
</div>
<h1>Hello World!</h1>
</body>
</html>
So, what am I missing?
Poor debugging on my part. I should've debugged in fresh Firefox profile first.
Anyways, the culprit was the Google Analytics Opt-out Add-on (by Google) addon. I disabled it and no more CSP error in console.
This question already has answers here:
ReWrite rule to add .html extension
(10 answers)
Closed 6 years ago.
What would be the best way(and how would I) redirect a url such as :
www.samplesite.com/support
To an actual file :
www.samplesite.com/support.htm
Create a file inside support called index.html with this inside
<meta http-equiv="refresh" content="0; url=www.samplesite.com/support.htm/" />
This way, when the user goes to www.samplesite.com/support.htm the meta refresh will redirect him to the desired file: support.htm
#NinethSense says here
Use of meta refresh is discouraged by the World Wide Web Consortium (W3C). Ref: en.wikipedia.org/wiki/Meta_refresh. So it is recommended to use server redirect instead.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
Let say I have a webpage: www.test.com/action
On that url there is a page with a automatic redirect in the HTML, so it will redirected to another page: action.blabla.com.
I want google to only index the redirect page, and prevent to index the page where is redirected to.
How can I accomplish this?
Canonical link:
https://support.google.com/webmasters/answer/139394?hl=en
Quoted:
Add a rel="canonical" link to the section of the non-canonical version of each HTML page.
To specify a canonical link to the page http://www.example.com/product.php?item=swedish-fish, create a element as follows:
Copy this link into the section of all non-canonical versions of the page, such as http://www.example.com/product.php?item=swedish-fish&sort=price.
If you publish content on both http://www.example.com/product.php?item=swedish-fish and https://www.example.com/product.php?item=swedish-fish, you can specify the canonical version of the page. Create the element:
Add this link to the section of https://www.example.com/product.php?item=swedish-fish.
Indicate the canonical version of a URL by responding with the Link rel="canonical" HTTP header. Adding rel="canonical" to the head section of a page is useful for HTML content, but it can't be used for PDFs and other file types indexed by Google Web Search. In these cases you can indicate a canonical URL by responding with the Link rel="canonical" HTTP header, like this (note that to use this option, you'll need to be able to configure your server):
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
So, I just wanted to ask you is it really necessary to put 301 redirect in your .htaccess file?
I mean, I this is my old URL :
http://www.sample.com/tutorials.php?name=sample
and this is the new one :
http://www.sample.com/tutorials/programming/sample.php
So, I tought I had to have 301 redirect, but people said that Google (and other search engines), will figure this out themselves. So, will my web-site be more SEO friendly if I put 301 redirect or will it be as friendly as a site without an 301 redirect?
Side note : I would re-upload my sitemap in Google Webmaster tools.
Thanks in advance!
I suppose you moved the content and the old url is now an empty 404 page. Well, even if Google will understand it, Google just loves to have it's work made easier by webmasters. Moreover, your page may have got so external links, you have to make a 301 to keep these links useful.
Make your 301 in the .htaccess and leave it here forever, and always make 301 when moving content to another url.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Is it Okey to do like the following for SEO purpose:home, or do I need to do it like this:home?
In each page of my website, do the links in navigation count as "internal links", why cannot I get the list of internal links in "Internal links" in Google Webmaster?
There is no difference between absolute and relative path as search engine crawler will treat both in same manner.
But; when any one copy your link provided as absolute path, they can easily get the whole link and can share exact URL on their website.
In short, you do not need to use absolute links to optimize for search engines. Search engine crawlers will be able to figure out the structure of your site. Using absolute paths is actually beneficial, because if you ever need or want to change your domains you will not have to hunt and peck over your entire site's codebase to resolve it.
Although it won't make a huge difference, if your're really worried about it you can use the canonical tag in your HTML head.
<html>
<head>
<title>This is my site</title>
<link rel="canonical" href="http://www.mydomain.org/mysite" />
</head>
<body>
</body>
</html>
Google Webmaster blog post about canonical link best practices
Wikipedia description of canonical link tag
There is no difference as far as SEO goes for using absolute vs. relative for internal linking. But if you are using absolute, you might see your own domain show up as a referrer in your analytics.
If you want to use relative paths, then use <base href=""> in your head ... see http://www.w3schools.com/tags/tag_base.asp
Here are some other related suggestions in regard to rel="canonical" SEO, and analytics:
1) Google, when indexing pages, ignores everything after the # in your URLs, so use # instead of ? ... Then, for your SEO purposes, Google will consider:
http://example.com/pagename.html
and
http://example.com/pagename.html#var1=FOO&var2=BAR to be the same page.
2) You can also set in the head of your pages:
<link rel="canonical" href="http://www.example.com/pagename.html" />
see: http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html
3) As far as reporting goes, in google analytics, they support use of # as query string delimiter, see: https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiCampaignTracking#_gat.GA_Tracker_._setAllowAnchor
4) In your google analytics profile, you can also set it to exclude query string parameters. See: http://support.google.com/analytics/bin/answer.py?hl=en-GB&answer=1010249
I prefer method #1. All of my tracking URLs for campagins and all internal links and logic use # as the query string delimeter so I can maximize my link juice to the canonical domain (no www subdomain in my canonical) I set in .htaccess like this:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
Here my suggestion would be to use either '/' or 'www.mysite.com' instead of appending index.php. Let everything resolve to your root domain.
If both root domain name & index.php exists, it might create duplicate content problem.