Taff's Web Development and SEO Blog

Suchmaschinen optimierte Domainname für die Baubranche

Posted in SEO by Adrian on August 16, 2009

Vor kurzem habe ich den Domainnamen bau-spezialisten.de registriert. Aus Suchmaschinenoptimierungssicht ist dieser Domainname gerade für Betriebe im Baubereich eine echte Goldgrube. Ich kann mir gut vorstellen, dass sich der Domainname auch für einen Handwerksbetrieb eignen könnte.

Die Treffer, die ich dort in nur einer Woche verzeichnen konnte, waren sogar für mich, der sich seit längerem mit dem Internet und den darauf bezogenen Statistiken befasst, überraschend.

Wenn man in Betracht zieht, dass der Domainname nirgendwo aufgelistet ist und trotzdem Page Impressions allein in der ersten Woche im 2-stelligem Bereich liegt, könnte sich diese Domain mit etwas Suchmaschinen-Marketing Unterstützung zum echten Brenner entwickeln.  Des Weiteren habe ich eine CTR von ca. 40 %, was wiederum zeigt, das Besucher in der Tat einen Spezialisten im Bereich Bau suchen.

Falls ihr so einen Profi seit und Interesse habt, lass es mich wissen.

Grüße aus Hamburg

Tagged with: , , ,

Encrypted Email Address with PHP and Javascript

Posted in JavaScript, PHP by Adrian on August 15, 2009

Anybody in the know worries about posting their email address anywhere without encrypting it first. In my opinion using email “encryption” techniques like person[at]domain[dot]com aren’t going to stop a lot of bots nowadays. If you have PHP and Javascript possibilities, you can go a lot further.

This is a little PHP script that I use a lot.

<?php
function encryptAddress($address){
	$output="<script type=\"text/javascript\">";
	$output.="var listOfEncryptedLetters=[";
	for($i=0;$i<strlen($address);$i++){
		$output.= ord(substr($address,$i,1)).",";
	}
	$output = substr($output, 0, -1); 
	$output.= "]\n";
	$output.="
	var newName='';
	for (var i=0; i<listOfEncryptedLetters.length; i++)
	 newName+=String.fromCharCode(listOfEncryptedLetters[i])
	document.write('<a href=\"mailto:'+newName+'\">'+newName+'</a>')
	</script>";
	return $output;
}
echo encryptAddress("info@test.html");
?>

Using a simple PHP loop, we consecutively convert each letter of the string passed to the function into it’s equivalent ASCII value and add it to a Javascript array.

var listOfEncryptedLetters=[105,110,102,111,64,116,101,115,116,46,104,116,109,108]

The next step is to output our encrypted ASCII code as Javascript, with which we generate our anchor with a mailto:.
The output should look something like this now:

<script type="text/javascript">var listOfEncryptedLetters=[105,110,102,111,64,116,101,115,116,46,104,116,109,108]

	var newName='';
	for (var i=0; i<listOfEncryptedLetters.length; i++)
	 newName+=String.fromCharCode(listOfEncryptedLetters[i])
	document.write('<a href="mailto:'+newName+'">'+newName+'</a>')
	</script>

Hope this helps. If you don’t have PHP available but would like this script, holler and I’ll throw up a form to automatically generate code so you can just copy and paste.

SEO-Optimierte Domainnamen für Business Software

Posted in SEO by Adrian on August 11, 2009

Letzte Woche war ich sehr überrascht als ich nach ein paar Domainnamen geforscht habe.

Viele Suchmaschinen-optimierte Domainnamen (Keyword Domains) waren noch nicht registriert. Insbesondere wunderte ich mich, dass Domains mit Begriff und zugehöriger gängiger Abkürzung noch verfügbar waren, so z.B. Enterprise Resource Planning und seine Abkürzung ERP. Domainnamen wie enterprise-resource-planning-erp.de oder erp-enterprise-resource-planning.de sollten doch für führende Anbieter dieses Segmentes, wie SAP, Infor, Oracle, Microsoft Dynamics etc., von großem Interesse sein – gerade aufgrund der Suchmaschinenthematik. Eine Weiterleitung auf die „echte“ Internetadresse des Anbieters ist schließlich mehr als einfach.

Auch in andere Bereichen waren Domainnamen frei: public-relations-pr.de als Beispiel.

Mir fehlt auch eine vorausschauende Mentalität der Verantwortlichen bei der Domainnamen-Auswahl. www.erp-ueberall.de bzw. www.erp-überall.de oder www.erp-in-ie.de eignen sich doch hervorragend als Domainnamen für die “ERP II”-Welle….

Weiteres Phänomen ist „Business German“. Zwar ist business-software als Domainname registriert, geschaeftsanwendungen.de jedoch nicht – viele IT-Verantwortliche (und gerade ältere Menschen) sind aber mit der deutschen Sprache groß geworden und dadurch geprägt. Hier wäre Geld für die Registrierung gut investiert. Dies muss nicht soweit gehen, dass man sich nun „IT-Auslagerung“ unbedingt sichern muss, IT-Outsourcing ist hier der global einheitliche Begriff.

Tagged with: , , , ,

Setting up multiple databases with cakePHP

Posted in cakePHP by Adrian on August 7, 2009

Yet again I been pleasantly surprised at how easy cakePHP handles things. This time it’s the use of multiple databases. The current setup of our system has data stored in 4 databases.

For our example we will presume our multiple databases are setup as such:

We have a users database (which contains everyone we have ever had contact with) and is used by our CRM software. We then have our database containing all the products that our application has stored.

Our first step would be to configure all our configurations in app/config/database.php. It could look something like this:

<?php
class DATABASE_CONFIG {
	var $default = array(
		'driver' => 'mysql',
		'persistent' => false,
		'host' => 'localhost',
		'login' => 'hopefully_not_root',
		'password' => 'hardtoguess',
		'database' => 'products',
	);
	
	var $users = array(
		'driver' => 'mysql',
		'persistent' => false,
		'host' => 'localhost',
		'login' => 'hopefully_not_root',
		'password' => 'hardtoguess',
		'database' => 'users',
	);
}
?>

I know it’s hard to believe but cakePHP will use default if it’s there. What an apt name! ;-)

Our Products model will then look something like this:

class Product extends AppModel {

    var $name = 'Product';
    //The next line could be omitted...default is default ;-)
    var $useDbConfig = 'default';
    
    //Validation etc.. could go here
    
} 

Our Users Model would look similar:

Our Products model will then look something like this:

class User extends AppModel {

    var $name = 'User';
    var $useDbConfig = 'users';
    
    //Validation etc.. could go here
    
} 

That’s it.

$this->Product->find() will now query our products database, and $this->User->find() our users database.

Taff

Tagged with: ,

Adding search engine friendly URL’s (Slugs)

Posted in cakePHP, SEO by Adrian on August 5, 2009

I was looking for a quick way to add search engine optimised URL’s to my cakePHP application and was amazed at how fast it was setup.

These are the (extremely simple) steps that I took.
Add a slug field to my database table

ALTER TABLE `the_table_name` ADD `slug` VARCHAR(255) NOT NULL;

Update our table to add slugs, related to the title

For the sake of ease I simply added an extra line to my edit method. This doesn’t check anything and will resave the slug whenever the title is changed…but it worked for testing ;-)

if (!empty($this->data)) {
 $this->data['Controller']['slug'] = Inflector::slug($this->data['Controller']['title_we_want_adapted']);
 if ($this->Controller->save($this->data)) { $this->Session->setFlash(__('Saved', true));
 } else {
 $this->Session->setFlash(__('Not saved. Please try again.', true));
 }
 }

Note our use of the built in Inflector::slug class method. We should probably have converted to lowercase too.

The next step was to change links that previously pointed to
/path/to/app/controller/method/id
to now point to
/path/to/app/controller/method/the_slug_we_generated

What’s left to do? Well if we click on our newly generated link, it probably won’t find the row it needs because it will be doing something like:

SELECT * FROM `the_table_name` WHERE `id` = the_slug_we_generated;

I personally already had a beforeFilter() in my controller to prevent users accessing Lists that didn’t belong to them so I updated it in the following way to ensure that both slugs and id would work (May come in handy if people have links bookmarked with the old method).

	function beforeFilter() {
		parent::beforeFilter(); 
//Are there any parameters for this action, i.e. is it an edit or view 
		if(isset($this->params['pass'][0])){
			$id=$this->params['pass'][0];
//Is it numeric, in which case its an id already (we hope at least)
				if(!is_numeric($id)){
					//If its a slug, we need the related item.
$new_id=$this->currList=$this->Dolist->find('first',array("conditions"=>array('Dolist.slug'=>$id)));
					$id=$new_id['Dolist']['id'];
//So we know it's using a slug
					$this->usesSlug=$id;
				}
			$this->currList=$this->Dolist->find('first', array("conditions"=>array('Dolist.id'=>$id)));
			//Check User stuff
			if($this->currList['Dolist']['user_id']!=$this->Session->Read('Auth.User.id')){
					$this->Session->setFlash("You're not authorised to ".$act." ID:".$this->params['pass'][0]." or it no longer exists");
					$this->redirect(array('action'=>'index'));
				
			}
			
			
		}
	}

I then updated my view method

	function view($id = null) {
		if (!$id) {
			$this->Session->setFlash(__('Invalid Dolist.', true));
			$this->redirect(array('action'=>'index'));
		}
		if($this->usesSlug!=0){
			$id=$this->usesSlug;
		}
//Carry on as normal....

For search engine optimisation we should probably set a redirect in the controller if it’s an ID but thats up to you.

Don’t you just love how easy things are to setup with cakePHP? ;-)

Tagged with: ,

How I increased Page Impressions (PI’s) by over 1400% in under 3 months

Posted in SEO by Adrian on August 4, 2009

With the aid of some simple keyword analysis and a few basic Search Engine Optimisation tips (which I will go into later) I managed to increase the average Page Impressions (PI’s) from 3500 to over 50000 in a little over 2 months. These are the tools I used for the SEO and other parts of the relaunch of trendlux pr.

Google Analytics
Most people who have ever even taken a look at SEO, will probably have stumbled across Google Analytics. It has an amazing amount of functionality, allowing website owners/webmasters to track visitors, content, traffic sources and keywords to name just a few. To sum up if you aren’t using it…you should be, unless of course you don’t plan on helping Google towards world domination. It’s a simple case of copying and pasting some Javascript into your webpages/templates. I find it a great tool towards optimising content and keywords.

MODx CMS
MODx has been my CMS of choice for a long time now. I am now at a point of being able to get a site setup and optimised for search engines (Friendly URL’s and a couple of snippets I have to generate meta tags) very quickly. I am still using the “older” 0.9.6. version, and still haven’t found the time to take to the steep learning curve of the current beta version. Back then, MODx won over typo3 because I didn’t insist I learned a new language, a bit of PHP, CSS and optionally Javascript surficed to get some great designs “CMS’ed”.

SEObook
A good place to start when on the outlook for some SEO tips. There are also quite a few tools that you can embed into Firefox, making things easier (providing you use Firefox of course :-)

Webmaster Tools
A lot of the functionality is identical to Google Analytics, but I still find Webmaster Tools a handy tool to have. I point it towards a sitemap and it does the crawling, informing me of crawling errors or HTML suggestions towards optimisation and I can even have it in my iGoogle as a dashboard so I can see straight away when something has gone wrong.

Keyword analysis
First step was finding the keywords we wanted to focus on. I used Google’s Keyword Tool to find fitting words, focussed around our location and the key services we offered.

Template
Most importantly here was that the template had room for a couple of header tags and conformed to W3C standards. The Press releases have the option in the backend for adding Tags, h1 tags and defining a SEO friendly URL. All this functionality came (more or less) as default with MODx

Twitter
I am in no way a fan of twitter, but posting our press releases with a “shortened URL” has definately got more traffic to our site. That combined with su.pr (StumbleUpon’s shortenURL Service) has amounted to roughly 10% of our traffic since the relaunch. We don’t tell people what we had for lunch though ;-)

Ongoing Optimisations
There is still a lot to be done. Back Links play a large part, along with getting us more prominently placed on Social Media platforms. Maybe then we can compete with Press Release services and get ranked higher than them…after all it is our content they are displaying. I’d really like to publish it at least a day before those services, which would certainly help, but as yet that isn’t possible.

Afterthought
There are other things I took into account, but they are in no way secret and can be found easy enough if you spend a little time on SEO.

Deleting related items

Posted in cakePHP by Adrian on August 4, 2009

How often have we messed about with mysql queries when deleting for example a user from our todolist application, that also all their todolists, todolist items, user profiles etc. are also deleted. cakePHP makes this type of functionality child’s play.

All you need to do is make that model dependent (not dependant, a typo that cost me 20 minutes a few days ago). So in my todolists model I would have

var $belongsTo = array(
	'todoitems' => array(
		'className' => 'Todoitems',
		'foreignKey' => 'todolist_id',
		'dependent'=> true
));

Calling

$this->Todolist->del($id)

will now not only delete all Todolists, but also any related items with a corresponding todolist_id. Setup once and it’s a “fire and forget” as we used to say in the Army.

Tagged with: ,

Add an attribute to $html->link

Posted in cakePHP by Adrian on August 4, 2009

I have no idea why this isn’t found here but to add attributes such as title, class or ids to a link, you need to add a third parameter as an array:

echo $html->link($dolist['Dolist']['name']), array('controller'=>'Dolist','action'=>'view', $dolist['Dolist']['id']),array('title'=>$dolist['Dolist']['description']));

where the first is the text displayed the second array is the actual link, divided into controller (optional), action and parameters (also optional), and the third takes all your html attributes like title, class etc.

Tagged with: ,
Follow

Get every new post delivered to your Inbox.