canonical-link

How do I get the final, redirected, canonical URL of a website using PHP?

♀尐吖头ヾ 提交于 2019-12-03 05:35:35
In the days of link shorteners and Ajax, there can be many links that ultimately point to the same content. I was wondering what the best way is to get the final, best link for a web site in PHP, hopefully with a library. I was unable to find anything on Google or GitHub. I have seen this example code, but it doesn't handle things like a rel="canonical" meta tags or default ssl ports: http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/ Facebook seems to handle this pretty well, you can see how they follow 301's and rel="canonical", etc. To see examples of the way Facebook

How to correctly canonicalize a URL in an ASP.NET MVC application?

走远了吗. 提交于 2019-12-02 22:31:26
I'm trying to find a good general purpose way to canonicalize urls in an ASP.NET MVC 2 application. Here's what I've come up with so far: // Using an authorization filter because it is executed earlier than other filters public class CanonicalizeAttribute : AuthorizeAttribute { public bool ForceLowerCase { get;set; } public CanonicalizeAttribute() : base() { ForceLowerCase = true; } public override void OnAuthorization(AuthorizationContext filterContext) { RouteValueDictionary values = ExtractRouteValues(filterContext); string canonicalUrl = new UrlHelper(filterContext.RequestContext).RouteUrl

News gallery & canonical tag

∥☆過路亽.° 提交于 2019-12-02 22:03:44
问题 I have a news site about global sport industry. There are news, and some of the news have galleries, such as: News URL: example.com/news/tiger-woods-win-the-cup Gallery URLs: example.com/news/tiger-woods-win-the-cup/1 example.com/news/tiger-woods-win-the-cup/2 example.com/news/tiger-woods-win-the-cup/3 Should I add canonical tag into the gallery HTML as like below? <link rel="canonical" href="http://www.example.com/news/tiger-woods-win-the-cup" /> Note: gallery pages have no written content

How can i get canonical url from facebook graph api in android?

寵の児 提交于 2019-12-01 14:07:43
Am trying to implement deep link on Facebook sharing in my android applcation. That deep link is only for mobile and not for webpage. So according to the facebook documentation Link1 Link2 am going through Link2. The following should be called to get id of canonical url. This canonical url will be set as a link on Facebook sharing. To get canonical id curl https://graph.facebook.com/app/app_link_hosts \ -F access_token="APP_ACCESS_TOKEN" \ -F name="Android App Link Object Example" \ -F android=' [ { "url" : "sharesample://story/1234", "package" : "com.facebook.samples.sharesample", "app_name"

How to configure redirects to url with trailing slash in nginx?

余生长醉 提交于 2019-12-01 05:31:11
问题 I want to redirect URLs without slash to the path with trailing slash. So /some-url to /some-url/ And the rest of the URLs, like /some-url.xml /some-url? /some-url?q=v /some-url/ Should stay without redirection. I found this article https://www.ateamsystems.com/tech-blog/nginx-add-trailing-slash-with-301-redirect-without-if-statements/ in which author suggests to use following rule: location ~ ^([^.\?]*[^/])$ { try_files $uri @addslash; } location @addslash { return 301 $uri/; } Unfortunately

How to remove a duplicate title tag and meta description tag with canonical link

给你一囗甜甜゛ 提交于 2019-11-30 21:02:45
问题 I have run SEO tool for my website, it showed that I have a duplicate title tag and meta description tag, both are in "domain.com/" and "/index.html" , they are the same file. How do I use Canonical Link to remove the duplicate tags ? Please help. Thanks. 回答1: if it's showing up just in SEO software don't worry about it, Google's smart enough to know it's one page 回答2: You're coming across a classic duplicate-content issue. The quickest way to get around this is to edit your index.html page

Can the canonical tag be used on all pages?

∥☆過路亽.° 提交于 2019-11-29 17:57:14
Im working on a site that has had an SEO expert review it. They have advised me that we should apply canonical tags on every other page <!-- http://www.example.com/detail/table&r=dining-room --> <link rel="canonical" href="http://www.example.com/detail/table"/> is it really required that the canonical tag only appears on every other page, or will it play nicely if it appears on the same page? The reason I ask this is: isn't the link also telling Google that it is infact on the right page? RFC 6596: The Canonical Link Relation specifies : The target (canonical) IRI MAY: o […] o Be self

JVM Crash Problematic Frame: Canonicalizer::do_If

若如初见. 提交于 2019-11-29 16:54:13
Iam facing JVM Crash cosistently while enabling hotdeploy (USING below java options on starting up JAVA_OPTS -Xmx4096m -XX:MetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=crash -XX:ThreadStackSize=512 -XX:+UseConcMarkSweepGC -XX:ParallelGCThreads=5 -XX:NewRatio=2 -XX:+UnlockDiagnosticVMOptions -XX:-UseLoopPredicate -Xdebug -Xrunjdwp:transport=dt_socket,address=$DEBUG_PORT,server=y,suspend=n -XX:NewRatio=2 -Dspringloaded.synchronize=true JAVA_OPTS=`echo $JAVA_OPTS -Dspringloaded.synchronize=true -javaagent:springloaded-1.2.1.jar -noverify ) Environment : JDK 1.8 U 66, RHEL 6

Can the canonical tag be used on all pages?

a 夏天 提交于 2019-11-28 13:09:16
问题 Im working on a site that has had an SEO expert review it. They have advised me that we should apply canonical tags on every other page <!-- http://www.example.com/detail/table&r=dining-room --> <link rel="canonical" href="http://www.example.com/detail/table"/> is it really required that the canonical tag only appears on every other page, or will it play nicely if it appears on the same page? The reason I ask this is: isn't the link also telling Google that it is infact on the right page? 回答1

JVM Crash Problematic Frame: Canonicalizer::do_If

╄→гoц情女王★ 提交于 2019-11-27 08:27:29
问题 Iam facing JVM Crash cosistently while enabling hotdeploy (USING below java options on starting up JAVA_OPTS -Xmx4096m -XX:MetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=crash -XX:ThreadStackSize=512 -XX:+UseConcMarkSweepGC -XX:ParallelGCThreads=5 -XX:NewRatio=2 -XX:+UnlockDiagnosticVMOptions -XX:-UseLoopPredicate -Xdebug -Xrunjdwp:transport=dt_socket,address=$DEBUG_PORT,server=y,suspend=n -XX:NewRatio=2 -Dspringloaded.synchronize=true JAVA_OPTS=`echo $JAVA_OPTS