Alan Edwardes Print Logo
HomeArchivesAboutContactLabsRandom Post

Posts Tagged ‘Website



Using HTML in .htaccess To Cover Pretty HTTP Errors

Recently I had a massive sort out of the domains, subdomains and other crap hosted here and found out that most of the time if a user got a 404 page, they got the default Apache 404 page, not a pretty error with a home link on it. So, I setup a .htaccess file in the top level folder of my webspace, so that it covered the entire of my website and everything on it without overriding any other .htaccess errors in child directories.

For instance, if you visit http://aelabs.net/thispageisnotfound/, you’ll get the same error page as you would get if you visited http://p.alanedwardes.com/notfoundeither/. I’ve also specified other general errors in the htaccess file, such as 403 erorrs, typically received when I haven’t set a root document, E.G. http://p.alanedwardes.com/.

It’s also a good way to make sure the Mint auto track PHP file is used on every single page here too, as i’ve added that into the file too. The end result looks something like this:

AddType application/x-httpd-php .html .htm
php_value auto_prepend_file /home/[username]/sites/mint/config/auto.php

ErrorDocument 400 "<style>body{font-family:'Lucida Sans Unicode', Garuda, Trebuchet MS, Arial, Tahoma;}</style><title>Bad Request</title><h1>Error 400 - Bad Request</h1><p>Your browser sent the server a request that it is not able to process.</p><p><a href="http://alanedwardes.com/">Home</a> | <a href="http://alanedwardes.com/contact/">Contact</a>

Read the rest of this post »

A Website Guide For Dummies

I guess the internet can be a magical place for new users who don’t know what’s what, but a confusing place too. If you want to create a web site you have to search around and find out how to do it yourself, there isn’t much explaining going on.

So, i’ve create this guide. It’s designed to help people get on with their own website, using companies that I use and find great to be a customer of. It’s also a guide to direct people who ask me how to make a website to, as i’m planning to explain everything from domains to a simple guide of setting up something like Drupal with cPanel, something that is offered as standard with my current host A Small Orange.

Read the rest of this post »

Using The HTML “base” Element

Yeah it’s not the most widely used element; partly because it doesn’t really have much of a use except for sites that cache data like the Wayback Machine and search engine caches, like the Google cache service. In these services, the element is used in the header of the cached page to make the browser treat all relative links like they belong to the original URL. An example of it being used is typically (XHTML):

<base href="http://www.thecachedsite.com/"/>

But, you can also make it change all of the targets of links on a page. For example:

<base target="_blank"/>

..would make all of the links on the page it is put on open in a new page. This could be used in pages that have uncontrollable content, like pages which use JavaScript to write some data pulled from elsewhere for example, where you still have control of the header of the page.

Why did I post this? Well, I think it is a slightly unheard of HTML element, and one that could prove very useful if it was ever needed. The advantage of using this instead of JavaScript to achieve the same thing is that this will work where JavaScript isn’t enabled. Awesome.

Google Sitesearch - Search Sites Quickly And Easily

So, I used to use the Google sitesearch feature for my website for a bit before I moved over to the WordPress search engine, and I think that it is a useful feature of Google to not only specifically search your own site add-free, but to search other sites quickly. Google have released the custom search engine software, but it isn’t easy to quickly search a site normally with.

So, if I wanted to specifically search a site like aelabs.net, I could just search Google normally for the terms I wanted, then add in the “&sitesearch=aelabs.net” into the URL. Sound too complicated? Well, you could also search Google with “site:aelabs.net IP“, which would also yield the same results.

This is useful not only for searching websites that do not have a built in search engine but for also obtaining more accurate results in some cases.

Quickly Validate Pages Using The Bookmarks Toolbar

You can use your bookmarks toolbar folder on your browser to quickly validate web pages using the W3C validator. Just drag the buttons below onto your toolbar, and hit either one when you want to validate a page.

W3C Markup ValidationW3C CSS Validation

Another use for the JavaScript is to put the links on a web page, implementing them to make sure that you don’t get any no referrer header found errors. You can always make the JavaScript an onclick reference with a return false, and have the link point at “http://validator.w3.org/check?uri=referer” for the small number of people without JavaScript enabled.

Blogging ≠ Copying Other People’s Content

I am seriously sick to death of the fucking retards that can’t write blog posts from their own minds, so instead copy other people’s and make the content look like their own.

You know, the kind of dicks that prey on people’s personal blogs, like this one, and copy the content leaving little evidence of the original author. I’ve never taken this approach to blogging, and every single post on this blog has been formulated from my head; from my creativity. I think that the minority of bloggers have completely missed the point of blogging altogether, and assumed that hey, it’s on the internet, why not just copy it?

For example, this site is relatively small. Just take a look at my Mint installation and you will see that I get around 30-40 unique visitors a day. So, what I don’t need is people taking my content, and posting it on their website.

But, that is exactly what has happened with my “Installing and Configuring Lampp” post, which has proved my most popular post, but has also proved the most prone to copying. Why the fuck you would do that I don’t know, but the fact that people do copy pisses me off beyond belief.

So, if you’re not clever enough to write your own blog posts, and instead prey on other people’s websites, I don’t think blogging is right for you, eh?

mail@wr-clan.co.uk