Tag Info

Hot answers tagged

11

According to the current version of the HTTP/1.1 standard, RFC 2616, the value of the Location header must be an absolute URI. However, in the draft standard prepared by the HTTPbis Working Group to eventually replace RFC 2616, this has been changed to allow relative URIs as well, apparently because: "The definition of the Location header [in RFC 2616] ...


9

Personally I would put domain.com on contact cards,etc and have it redirect to www.domain.com. This can be done with a simple rewrite. The reason for this is that my users should never be concerned with having to type www. I absolutely hate sites that require people to type the www - I think it's a completely outdated requirement from years gone by. You ...


8

If your framework/CMS/whatever has the appropriate functions, you can include the scripting conditionally as @Michael suggests, but without the additional library. Taking your datatables case, for example, WordPress might handle the situation via something like: // For reference; this isn't functional code. if (is_page('whatever')) { <script ...


7

TCP already has error correction, but this only helps you on the TCP layer. An intermediary HTTP proxy or load balancer can corrupt the data on the HTTP layer, and then retransmit it. A HTTP MD5 makes it possible to detect this corruption. The reason why nobody really talks about this need is that the problem is very rare indeed; most HTTP proxies etc "just ...


6

You may want to look into <link rel="canonical" />. See http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html. Down in the comments someone from Google says that it can be used for http/https issues. Caveat: I'm not sure if and to what extent <link rel="canonical" /> is supported by search engines other than Google, ...


6

Can the server be reached in other ways than through HTTP or externally? Well... the server itself can be accessed by different means. Depending on what services are running on the machine (as well as what ports are open). Is GET and POST only populated through the HTTP protocol? Yes Is HTTP headers, GET and POST the only source of input for a ...


6

Your example URL, http://example/cat/http://example/dog, points to a page accessed with the http protocol, on the host example, with the path cat/http://example/dog. It's perfectly valid for the path part of a URL to contain elements that look like the protocol and hostname parts of another URL. One relatively prominent example of a legit site using such ...


6

Section 14.30 of the HTTP 1.1 RFC http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30 is not significantly different. I don't know that you're going to see any actual practical limitations for this. The only time I've seen even a warning about this issue is when I used to test in Lynx and the location was not absolute it would warn you "Location ...


6

You can use requirejs to dynamically load the libraries you need only on that pages. Then you only have to load the requirejs (which is about 14k) on all pages, saving about 385kb. Integration is also very easy: just "wrap" the code you have with the require include stuff: require(["jquery", "jquery.alpha", "jquery.beta"], function($) { //the ...


6

According to RFC 2616 (HTTP/1.1), section 3.2.2, the URLs http://www.example.com and http://www.example.com/ are equivalent, and HTTP clients must normalize the former to the latter before sending the request to the server: "If the abs_path is not present in the URL, it MUST be given as "/" when used as a Request-URI for a resource (section 5.1.2)." ...


5

What I do: use vhosts for each site, including a vhost for the variant I want to suppress. This keeps all the configuration for a named site in one place. The duplication of content is minimal thanks to mod_macro. You want to issue a redirect, not rewrite internally, since the idea is to get the client to retry using the correct protocol. Make sure to only ...


5

You can use WebSockets to accomplish server-side pushing to the client. They allow you to open a connection to a server and receive responses from the server without issuing further requests from the client. The websocketstest page shows a WebSocket connection working in your browser (if it supports WebSockets), with an update of the server time pushed to ...


5

Besides there being more search engines than Google out there, there's also no reason to assume that Google won't ever change the way they treat 410 responses. Indeed, it seems that's already happened: the information Matt Cutts quotes in the video is from 2007, whereas this post from 2009 by John Mu on Google's Webmaster Central forums says otherwise: ...


5

700kb of JavaScript IS a performance issue, because it must be parsed after page load. Because of it, you should take care, that only those scripts, that are needed, are loaded. One big JavaScript may be OK on full AJAX sites, such as GMail, when the navigation is handled internally without leaving the single page. However, even full AJAX sites do dynamic JS ...


5

A user agent of Java/[version] is the default UA when making any web requests through the Java programming language. In other words, someone has written a spider-like program in Java, which is clearly parsing links incorrectly. As Dave suggested in the comments, the requests could be coming from another site - check the referring URL in your weblogs. In ...


5

Here are some areas to consider in general, without going into detail: Physical configuration/server specs: RAM (the more the better) CPU processor speed, and number of cores for multi-core applications Drive speed and physical RAID to increase read/write speed (not software RAID used for mirrors and backups) ... OS and server configuration: (This is ...


5

No, you do not need a separate registration. http:// or https:// are just protocol specifiers. The name will resolve to the same host. However, once you're on the hosted machine, the web server determines what to display. Often, HTTP (port 80) and HTTPS (port 443) can be routed to different pages. This should be configurable by the website admin/tools. In ...


4

A generic non-application way to force an entire directory and its subdirectories to use SSL can be achieved with Apache: Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} Simply put that in a the .htaccess file of the directory you wish to secure. If you put it in your root directory it ...


4

Most likely attempts at referrer spam, but these could also be malicious (i.e. remote file inclusion attempts or contact form spam - particularly if you're running software which could be identified as vulnerable). If possible, set up a script to log the post contents to see exactly what you're dealing with and get in touch with the ISP's hosting the ...


4

The correct Content-Type is application/javascript See: What is the Javascript MIME Type? on Stack Overflow


4

For google there is a meta tag called unavailable_after, which does exactly what I was looking for: It tells google to remove a certain page at a specific time in the future. It is the only way to achieve what I was hoping to accomplish: Getting the pages removed automatically, at the right time, not relying on the crawler to come back and notice the 410 ...


4

Regarding your second question: ::1 is localhost in ipv6. Regarding your third question: # Mark requests for the robots.txt file SetEnvIf Request_Method "^OPTIONS$" dontlog # Log what remains CustomLog logs/custom.log common env=!dontlog see also http://httpd.apache.org/docs/2.4/logs.html#accesslog


4

From here It's Apache polling its child processes to verify they're responding correctly. 31-2 - 0/0/44 . 0.00 41 0 0.0 0.00 0.92 ::1 mxx1.xx.com OPTIONS * HTTP/1.0 The second field, " - ", shows that this isn't an active connection.. It's the last connection that took place for this particular thread/process. Since Apache polls ...


4

I would add a robots.txt file to all of these sites with the code below in it if you are worried about Google attempting to crawl your site: User-agent: * Disallow: / Remember, Google needs to know your site exists before they will even scan it. So if you haven't created any links to the site or a Google Webmaster/Google Analytics account for the site ...


4

Your <Dav On directive is not complete (no need for <) -- I assume it's just a copy-paste issue. More importantly -- you are using <Location> directive ... but providing physical path on your file system/hard drive. That's wrong -- <Location> is used to match URLs, not directories; to match directories you need to use <Directory>. ...


4

You're correct. RED implemented the requirements from HTTPbis http://tools.ietf.org/html/draft-ietf-httpbis-p4-conditional-18#section-4.1. Normally, HTTPbis requirements are backwards-compatible with RFC2616 (i.e., they don't make implementations that were conformant to 2616 non-conformance now), but this change slipped through -- we'll be opening an issue ...


4

Yes it can, and you'll want to use an Apache htaccess file to rewrite the request. It will need to be configured in your VHost config if you are using one so that you can match on the port, as Apache doesn't know what https is in htaccess. RewriteCond %{SERVER_PORT} ^443$ RewriteRule ^(.*)$ http://example.com/$1 [L,R=301] This should redirect anything ...


4

See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3: The max-age directive on a response implies that the response is cacheable (i.e., "public") unless some other, more restrictive cache directive is also present. It's conceivable (likely?) that there are proxies in the wild which break this but since the only failure mode could be ...



Only top voted, non community-wiki answers of a minimum length are eligible