For when you need to do it and just do it quickly.
<?php header('Location:http://www.yoursite.com/new_page.html'); ?>
Improve your Google ranking with Peter Mahoney, 20+ years SEO & Wordpress experience
For when you need to do it and just do it quickly.
<?php header('Location:http://www.yoursite.com/new_page.html'); ?>
You really want to add this to your .htaccess file:
Redirect 301 / http://your-new-domain
Let’s break that down.
Easy peasy! Now all bookmarks, and search engine results will still be valid and get people to your new address, with one short piece of code.
http://petermahoney.net/search-engine-optimisation-seo-code/
With the new site and all I’ve some CSS to get through.
I wanted to make the “pre” element work as a code snippet display for me, and needed a fix to get it to wrap text (since the “width” attribute has been defunct for some time).
Here’s the solution!
pre { background-color: #F2F2F2; padding: 5px 5px 5px 5px; white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* Internet Explorer 5.5+ */ }
There is a slew of methods to speed your site up–which is not only the polite thing to do for your guests–but helps with Speed Engine Optimisation (SEO) too. Google in particular looks at how quickly your site loads when deciding how to rank your site in search results.
Now, if you’re familiar with web servers then everything you need to know is written below. If not, this is the sort of thing you want to have an expert do for you; a faster site is too good an opportunity to pass up.
Browser caching is a process whereby we’re able to reduce the number of HTTP requests the server needs to process, which reduced page load times. Your server tells the visitor’s browser not to look for certain files everytime–usually the file that don’t change often anyway.
Edit your .htaccess file for your site, and include this code:
## EXPIRES CACHING ##
# by Peter Mahoney of petermahoney.com
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##
Restart your web server, and you’re done!
Noe this isn’t all there is to optimising a website for speed. Especially WordPress websites. As you’ll know by now I’m a WordPress SEO expert so I really pay a lot of attention to speed. There are plugins, image compression techniques and even extra code snippets worth using.
When it comes to plugin choice for WordPress speed I recommend WP Rocket – it does a great job out of the box and with just a few setting changes you can really push the envelope. Using that as well as a series of manual image compression techniques I’m able to improve the average WordPress site’s speed by 40%!
Speeding things up usually does require a few manual tweaks to code here and there – it’s really a job for a professional rather than just trying it yourself (it’s all too easy to stop a site working properly with this stuff.)
I can’t recommend a faster site enough. For your users, SEO – hell even the good of the web itself. Let’s get that content flying.
Prices are quoted exclusive of VAT unless expressly stated.