links without http: like //code.jquery.com/etc [closed] - http

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
Lately I've noticed that some sites (such as jsFiddle) and some widgets such pinterest feed widget, and many others.
They started to use links in the format
//code.jquery.com/jquery-1.9.1.js
//assets.pinterest.com/js/pinit.js
what does the // means ?
is it the same as http ?
if // is the same as http why using it instead of http ?
if both are different, can I use it to link my website ?
as addition: I'm not sure, but I think I've seem some use //name:sub.domaine.com, am I wrong ? if those exist, what do they mean ?
Edit:
as explained in an answer bellow, I can use the // notation to make my links shorter, but when I use it for my website: Chrome changes the link to: file:/// which is not what I expected

This is a protocol-relative URL. If the page which includes it uses HTTP, then it's HTTP. If the page which includes it uses HTTPS, then it uses HTTPS.
This is convenient so that you can ensure that you don't fetch insecure resources in a secure page (this causes the "mixed content" warning you might have seen), without bothering with the overhead of SSL/TLS in a page which is delivered unencrypted anyhow.
It's similar to how URLs beginning with a single / are resolved relative to the current protocol and hostname, and URLs with no leading / or scheme are resolved relative to the current page's directory.

To keep it simple: most web browsers now do not require the full [http://www] anymore. So yes, to be cool and to keep the URL's short, you can skip the full [http://www.] and just use //

Related

link with utm not tracked due to language being added to link [closed]

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 1 year ago.
Improve this question
my client is sending a link to costumers across 3 countries with utm to track on google analytics. these links are send through linkedin, fb, twitter etc. something like this:
https://wwww.example.com/page?utm_source=linkedin_stem&utm_medium=cpc&utm_campaign=lk_stem_tkt
https://www.example.com/page?utm_source=facebook_stem&utm_medium=cpc&utm_campaign=fb_stem_tkt
however these links are not being tracked on analytics, i believe due to the language prefix being added as you enter the website, like this:
https://www.example.com/en/page
https://www.exemple.com/es/page
https://www.example.com/pt-pt/page
is there a way to track this utm's without mentioning the language prefix?
Analytics parses query parameters. It doesn't care about the path itself. However, in your examples with lang set, the utm params are missing.
So what I believe your issue is, is a trivial redirection from a url where the language is not set to a url where it's set. During the redirection, you lose your utm-params.
Most likely, the redirection kicks in before GTM has a chance to fire a pageview (utm-params have to be set just on one hit in a session), thus, the attribution is lost completely.
Now the best fix for it would be changing the redirection rule to pass query parameters to the destination url. It should be a trivial task for whoever set up the redirection in the first place. Presuming the redirection is backend-driven. There may be other fixes for GTM, but they are out of scope.

Wordpress: Redirect user after commenting [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm trying to redirect users after commenting on my Wordpress blog, can anyone steer me into the right direct? I just want it to redirect them once.
There are a few ways that you can do this. The first and simplest is just to write a little function for yourself to do it. You could put this into your functions.php file, in whatever theme you are using.
add_action('comment_post_redirect', 'your_redirect_function');
// A function that redirects your users after they have commented.
function your_redirect_function ($location, $comment) {
// Here all you need to do is return the url of your target page.
$page = 'http://www.stackoverflow.com';
return $page;
}
Sometimes it's better to use Wordpress plugins rather than adding functions to your theme's functions.php file, because if your theme has an update then you'll lose your function! There are some plugins available to do this - the most popular one is Yoast's (he has a plugin for everything doesn't he?) You can download it at http://wordpress.org/plugins/comment-redirect/
I've found Yoast's plugin to be a little limited though, because the redirect will only work once for each of your users. This is a good and bad thing - say you want to thank your user for a comment, then you can only do it once. But it's good if you're asking them to sign up to a service, say. The other popular comment redirect plugin that has more features (but it's not free unfortunately) is Comment Redirect.
Again, it's probably better to go for a plugin, because it will have more features - like limiting the number of times each user gets redirected - and it will also survive the updates to your theme.
Use the below filter hook
comment_post_redirect
For more details
http://codex.wordpress.org/Plugin_API/Filter_Reference
More samples below:
http://wordpress.org/support/topic/a-simple-redirect-using-comment_post_redirect-in-functionsphp
http://wordpress.org/support/topic/redirect-after-posting-a-comment

Can a URL start with "//"? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Is it valid to replace with // in a <script src=“…”>?
We have a site on http[s]://A.example.com/ that references some resources (JS and CSS) on http[s]://A.example.com/
It makes sense, and avoids some browser warnings, if the same scheme is used when referencing the resources as the main site A is using. Site A uses PHP, so we can programmaticly detect the current scheme (http or https) and insert that into the header of the page.
However, we have found that just using '//' instead of the scheme also works.
So site A may reference "//B.example.com/theme/main.css" without a problem in all browsers we have tried, regardless of whether we go to site A using http or https.
My question is: is this a valid URL? It seems to work, but I cannot find anyone else doing it, and I cannot find any examples of this being suggested or recommended.
Yes. It is called a protocol-relative URL. See also Can I change all my http:// links to just //?

Could my site being viewed in iframes hurt my SEO? [closed]

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 have studied most of the posts concerning web page being viewed in an iframe here but I was wondering if this can hurt the SEO of the framed site! I own a niece blog, lets call it mynieceblog.com and I recently found out that my web content, mynieceblog.com/mypostname.html, is viewed in an iframe by a site acting like a blog aggregator. A toolbar exists on top (has a closing button) and the url looks like aggregator.com/content/myposttitle.html The visitor can view my entire site content through this iframe and has the opportunity to visit relevant posts of other aggregated blogs. Here are my questions:
a. When a user visits mynieceblog.com/mypostname.html who gets to see visits/impressions on his google analytics?
b. Do I get incoming links from aggregator.com? Could this be possible only if the user closes down the toolbar?
c. Does this hurt the ranking of mynieceblog.com since I both see mynieceblog.com/mypostname.html and aggregator.com/content/myposttitle.html in search engine results for some keywords?
The view of my blog content through this aggregator does not hurt my site reputation. I have read that bandwidth use is an issue too! I am more concerned about my rankings and page views.
It can't harm you and probably gives you some credit. You found it yourself so it's getting traffic.
Your own Google Analytics code will be run so you will see the visitors. You can actually tell who is framing your website via the Hostname parameter in Google Analytics. Hostname seems to get set to the domain shown in the address bar.
Google does see the link but how much ranking you get from that is unknown. Somewhere between 0 and 100%! I have recently read a test where someone believed some framed content was indexed.
It cannot hurt your ranking. Worst case is that it ranks higher for a keyword so Google presents their page for you instead of yours directly.
If you're really worried about it then you could implement some JavaScript code to make your page break out of the frame. Something like this:
if (top.location != location) {
top.location.href = document.location.href;
}
If your viewer views your website through aggregator.com then surely i wont help you for SEO. For good SEO viewers needs to visit your site directly from aggregator.com
It's not a question of hurting your site reputation - it won't; however, will it benefit your site? I'm unsure, but if you get any benefit, I imagine it would be less than if your site was access directly.
As this article suggests, the SEs may be able to spider your content through the aggregator, but the aggregator won't gain from your content (framed content is rightly considered to be outside the site), and given the dynamic architecture of many aggregators, you may also not gain much/anything.
I would imagine that the you could consider exposure of your site through an aggregator could be considered an in-bound link, but it is unclear whether SEs would agree.

what is the purpose of a css link placed like this style.css?23409823098 [duplicate]

This question already has answers here:
Closed 14 years ago.
Duplicate of what does do in a css link
I've seen a few sites who list a stylesheet with parameters in it.
does anyone know what its called and what purpose they serve?
ex:
href="fonts.css?1169659562000"
The parameter is changed every time the content of the file changes. This allows the site hoster to set an infinite cache timeout, which keeps the browser from re-requesting the CSS. Without the parameter, updates would never reach the client.
See also the Stackoverflow Podcast #38 and the YSlow tool.
To force the browser to refresh the CSS link. It's more reliable than expires headings and the like.

Resources