Navigate/Search

Archive for the 'HTTP' Category

Useful Apache .htaccess tricks

Monday, March 2nd, 2009

Ask Apache is chock full of awesomeness but these are the links that immediately jump out.

ErrorDocuments:

List of 57 HTTP Status Codes and Apache htaccess file ErrorDocuments

Redirection:

301 Redirect Cheatsheet – mod_rewrite, javascript, cfm, perl, php, refresh, python

Advanced HTTP Redirection

I posted this previously for another alternative of redirecting users when your pages change.

And this for letting users know something has changed when your pages change.

SEO:

503 Status Code Search Engine SEO

Security:

Security Tips for Securing your website, server, blog using .htaccess

Random code-by’s, code blitherings and whatnot

Sunday, February 8th, 2009

I wasn’t sure what to call this one but this site has a random array of varied goodies in CSS, PHP, HTTP and IE-specific problems.

Deliver content for specific referers[sic]

Tuesday, January 27th, 2009

For example, if someone comes to your site via a Google search for “peanut butter,” make sure to deliver the content “peanut butter” as it pertains to your content.

I believe testing the referer[sic] is one of doing this.  I wonder if there are any others?

Use mod_rewrite to redirect one domain to another via GET

Tuesday, January 27th, 2009

Dave Child ran into this problem a while back when the idiotic Jack Daniels corporation decided to flex its mighty talons.

RewriteCond %{REQUEST_METHOD} ^GET [NC] # Only rewrite GET requests
RewriteCond %{HTTP_HOST} olddomain\.com [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} olddomain\.com [NC] # Otherwise block
RewriteRule ^(.*)$ - [F]

Redirect all GET requests to new domain (only redirecting GET because POST to old domain is almost certainly automated spam – no genuine users should ever be posting to old domain if it’s been completely redirected). Serve 403 to any other request. — Dave Child

Miscellaneous .htaccess tips

Tuesday, January 27th, 2009

It’s quite rare to find a useful forum post anywhere so I thought I’d make note of some useful information that was passed around.

http://www.webmasterworld.com/apache/3430745.htm

(Click here for an archived copy.)

http://corz.org/serv/tricks/htaccess.php

mod_rewrite and 403 errors

Tuesday, January 27th, 2009

I’m not entirely sure of the culprit here because on a Unix machine the problem does not exist.  If you are encountering “Error 403: Forbidden” errors try this on a Windows host.

Options +FollowSymLinks

http://www.phpfreaks.com/forums/index.php?topic=159470.0;wap2

The resulting explanation seems fairly solid but it simply cannot be true if it is working on a host without that option.  So, I wonder then if the Unix host has that directive enabled by default in all Virtual Hosts.

Hrmm…

The art of 404s

Tuesday, January 27th, 2009

Interesting, albeit odd, site about 404s — the error you get when a document does not exist at a specific URL.

http://www.plinko.net/404/custom.asp

EDIT: I actually forgot I linked another page on this site only a few hours ago.  No wonder this is a blog to remember items I come across.

More mod_rewrite goodness

Tuesday, January 27th, 2009

I figured I might as well throw another great mod_rewrite link here.

http://www.workingwith.me.uk/articles/scripting/mod_rewrite

Under Construction for everyone but you

Tuesday, January 27th, 2009

I used to have a small .htaccess file that contained information similar but I’ve apparently lost it somewhere.

This should give you an idea in the meantime.

http://www.mcqn.net/projects/rewrite_generator.php

Internet Explorer prefers its own 404s

Tuesday, January 27th, 2009

Here’s a nifty tip, although I’m not sure of its validity.

http://www.plinko.net/404/howto.asp?article=3