This is one that comes in handy a lot. Like many things in computing there are a number of ways to accomplish this. My favorite though is one fo the simplest.
But first, it’s probably worth asking why you would want a redirect page and just clarify what I mean. Let’s say you’ve moved your main site entry page. It used to be homepage.html and now it’s index.php. You don’t want traffic to be going to homepage.html and browsing the old site, or you want to get rid of it entirely and make them come to index.php. If they just bookmarked your domain name it’s probably no big deal, the webserver will automatically serve up the correct page, but IF they bookmarked homepage.html specifically (www.yourdomain.com/homepage.html) then your visitors will see an error 404 page not found. Some might be clever and remove the page name looking to see what else is there, but don’t count on that.
So you want a page that takes someone visiting it (say we name it homepage.html) and moves them to your main page. Here’s an easy way.
Create a very simple web document…
That’s the minimum we need for a blank web page. Now, between <head> and </head> add a line like this.
<meta http-equiv=”refresh” CONTENT=”5; URL=http://pageoraddressyouwanttoredirectto”>
Basically this is a meta tag that redirects the browser automatically. It takes two variables after Content…. the first is how many seconds before the redirect and the second is the address that you’re redirecting to. Now, if you want someone to read a message on the page, you might choose 10 or 15 seconds. If you just want to move them, I’ll choose 0 sometimes. 5 is enough to read the text that we might place to explain.
Between the <body> and </body> tags insert a line like this.
<p> You are being redirected to the correct page. If you’re browser doesn’t automatically redirect please click the link below </p>
<a href=”http://pageoraddressyouwanttoredirectto”>My new Page</a>
At this point save it and your done. Of course, you can get fancier, theme it to match your new site, add a title, etc. etc. But it can be a VERY simple start and maybe hang on to those that are following outdated links (or search engine crawlers that might reindex your site.)
Related PostsRelated Posts
- Custom Error Pages with .htaccess Ok, we've looked at controlling access to directories with .htaccess, but there are other neat tricks we can do that can add a bit of polish to your site. One that I've implemented lately is a custom error page. Now, we've all done this, clicked on a link and get......
- Having multiple domains direct to one web site Recently I've consolidated a few domain names that I've acquired to direct to this site, and a few others to direct to another site that I maintain. One of the things that I wondered about after I set things up in the sites control panel to receive requests as the......
- Search rankings and "where you stand" Search engine rankings are one of the concepts that I think is vaguely understood. It's amazing to me how a subtle change in a series of search terms (or quoting a pair of words) can so drastically alter the results. Let's say you're searching for discount shoes, there's a difference......
- How To Choose The Best Free Website Builder In the event you need to produce a website but you lack the technical abilities to design and write the program code for this, a free website builder might show a really sensible tool. There are many programs now available which produce full web sites in accordance to your requirements.......
- Profile Backlinks For Serps Building profile backlinks is really a speedy approach to get backlinks from high page rank domains to your site. Profile backlinks could be identified on most forums and several social networking sites and in most circumstances they are dofollow backlinks. When I 1st began out in Search engine optimization and......
- Incorporating Video To Your Web Page So You Can Add Content Material And Get Better Search Engine Ranking The one thing that usually gets neglected when it comes to search engine ranking is usually incorporating video to the web page. Additionally, you will find that this is something which can be done rather easily and also something that can boost your search positions in the search engines almost......
- Web translation
- Saving you from yourself or specifying which index file to use with apache
- Custom Error Pages with .htaccess
- Preventing web crawlers from indexing everything
- Virtual Server on Apache to listen on an alternate port