Jump to content

HTTP Server Headers Irony


chibineku

Recommended Posts

I heard of a strange HTTP response header code 418 - I'm a Teapot, which is returned, according to the mandate, when the device you're trying to control isn't a coffee pot, but a teapot instead.No, really.Anyway, I set it in my .htaccess file for such a time as I may need it, and, to check that it works, went to sinaesthesia.co.uk/418.html. I don't have a page set up yet, so it returned a 404 header. But, ironically, my actual custom 404 page didn't show. What's with that? My custom page is returned if you type random gibberish, but not if you fail to find a custom error page.

Link to comment
Share on other sites

You can send any status you want, e.g. Status: 8395 I Like Pie, and if your application recognises it, then it could be useful. Unfortunately, coffee pots and other automated home devices are nowadays most likely controlled by Z-Wave or one of the other home automation protocols, and not HTCPCP. Also note that the Request for Comments cited is informational only.Anyway, are you sure you set up your 404 error handler correctly? If I go to, say, http://sinaesthesia.co.uk/41dfs8.html, I still get the host's 404 page.

Link to comment
Share on other sites

Hm. See, if you try sinaesthesia.co.uk/41dfs8.htm it works right - it seems to fail if you put in a .html or .php extension, but it works if you have any other file extension or no file extension. I wonder if there is an error in my .htaccess file. Here it is, if you don't mind having a look:

RewriteEngine On#translate /category/psoriasis into category.php5?category=psoriasisRewriteRule ^products/([0-9a-z_-]+)$ /category.php5?category=$1#translate products.html into product_categories.htmlRewriteRule ^products.html$ product_categories.html#remember to change this to aromaclearRewriteCond %{HTTP_HOST} !^sinaesthesia\.co.uk$ [NC]RewriteRule ^(.*)$ http://sinaesthesia.co.uk/$1 [R=301,L]#Translate default page to rootRewriteCond %{THE_REQUEST} ^GET\ .*/index\.(php5|html|php)\ HTTPRewriteRule ^(.*)index\.(php5|html|php)$ /$1 [R=301,L]#translate any .html ending into .php5RewriteRule ^(.*)\.html$ /$1\.php5#change / for ?RewriteRule ^(.*)\.html/(.*)$ /$1\.html?$2#strip .html from search res pageRewriteRule ^(.*)search/(.*)$ /$1search_results\.html/search=$2#translate product details link from search res pageRewriteRule ^products/(.*)/(.*)/(.*)$ /product_details.php5?category=$1&title=$2&id=$3 [L]#Translate products/psorisis/chamomile-skin-cream-P[x] to productview.php5?id=1RewriteRule ^products/.*-P([0-9]+) /productview.php5?id=$1 [L]ErrorDocument 404 /404.php5ErrorDocument 403 /403.php5options -indexes

Link to comment
Share on other sites

Many of the major RFCs are around that age as well (or much older) - take RFC 821, defining SMTP - written in 1982!

Link to comment
Share on other sites

What Ingolme had in mind was that it was issued on 1 April... 1st of April... does it ring any bells? It had something with "fools" I belive...

Link to comment
Share on other sites

I hadn't noticed the date - my brain is AWOL recently. Anyway, does anyone have any ideas why my rewrite rules would cause the server to return a 404 error code and my custom 404 page to not be displayed?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...