< /p>
One of the most wasteful redirects
happens frequently and web developers
are generally not aware of it. It
occurs when a trailing slash (/) is
missing from a URL that should
otherwise have one. For example, going
to
07002
results in a 301 response containing a
redirect to
07003
(notice the added trailing slash).
This is fixed in Apache by using Alias
or mod_rewrite, or the DirectorySlash
directive if you’re using Apache
handlers.
Will this happen again? With the development of the Internet, this article is very old. I think I have been doing this for years. I don’t think I have discovered this situation recently, but I never noticed it again. Is this an Apache business? Does IIS 7 do this?
I am scared. Hold me.
The following are some truncation requests run from the terminal.
curl -I http://astrology.yahoo.com/astrology
HTTP/1.0 301 Moved Permanently
Date: Tue, 21 Jun 2011 13:24:24 GMT
Location: http://shine.yahoo.com/astrology/
curl -I http://wordpress.org/extend
HTTP/1.0 301 Moved Permanently
Server: nginx
Date: Tue, 21 Jun 2011 13:26:17 GMT
Location: http://wordpress.org/extend/
Although it seems that IIS does it in another way:
curl -I http://www.iis.net/overview
HTTP/1.0 200 OK
Server: Microsoft-IIS/7.0
curl -I http://www.iis.net/overview/
HTTP/1.0 301 Moved Permanently
Location: http://www.iis.net/overview
Guess it depends on how you configure it, but it is definitely optimized.
I am reading about Yahoo’s “Best Practices” for Speeding up a website article referenced by Jeff Atwood, I noticed this little gem:
One of the most wasteful redirects
happens frequently and web developers
are generally not aware of it. It occurs when a trailing slash (/) is
missing from a URL that should
otherwise have one. For example, going
to
07002
results in a 301 response containing a< br> redirect to
07003
(notice the added trailing slash).
This is fixed in Apache by using Alias
or mod_rewrite, or the DirectorySlash
directive if you’re using Apache< br> handlers.
Will this happen again? With the development of the Internet, this article is very old. I think I have been doing this for years. I don’t think I have discovered this situation recently, but I never noticed it again. Is this an Apache business? Does IIS 7 do this?
I am scared. Hold me.
Try it!
The following are some truncation requests run from the terminal.
curl -I http://astrology.yahoo.com/astrology
HTTP/1.0 301 Moved Permanently
Date: Tue, 21 Jun 2011 13:24:24 GMT
Location: http://shine.yahoo.com/astrology/
curl -I http://wordpress.org/extend
HTTP/1.0 301 Moved Permanently
Server: nginx
Date: Tue, 21 Jun 2011 13:26:17 GMT
Location: http://wordpress.org/extend/
Although it seems that IIS does it in another way:
curl -I http://www.iis.net/overview
HTTP/1.0 200 OK
Server: Microsoft-IIS/7.0
curl -I http://www.iis.net/overview/
HTTP/1.0 301 Moved Permanently
Location: http://www.iis.net/overview
Guess it depends on how you configure it, but it is definitely something optimized.