"I did not become a vegetarian for my health, I did it for the health of the chickens."Isaac Bashevis Singer
|
| |
Are You Content With Your Content? Following are Five Immediate Changes You Can Make to Drive Traffic and Sales Through the Roof 1. Put More Oomph in Your Articles. Don't tell the reader what he "could" do; tell him what he MUST do! Which of these sounds more dynamic to you: great copy, ...
So, You Want Your Own Website? Is Free Or Paid Hosting Right For You? You have made the decision to build a website! Good for you. Whether you are simply looking for a way to show off your family, to try your hand at making money from an affiliate program or to go into a full-fledged business, your first decision is going ...
Untangling Spaghetti HTML Untangling Spaghetti HTML=========================by Sunil Tanna, EBookCompiler.comWhen I was first learning to write computer programs, one of themost important points that was drummed into me was that it'snever a good idea to write great chunks of ...
|
|
|
| |
Have you ever noticed that some people have really nice error pages when a page doesn't exist on their site? Wouldn't it be nice if you could make your error page match the rest of your site? Don't fret; you can do it! All you'll need to do is use a handly little file called .htaccess.
First thing you need to know is that .htaccess is a very powerful file that controls a lot of important parts of your site. Before you change anything, make sure to make a backup copy. If anything goes wrong, you can revert to the backup. If there isn't already an .htaccess file on your server, you can create one in Windows Notepad or your favorite HTML editor. If you're using Windows, make sure you save the file as ".htaccess" including the quote marks.
Next, you need to little bit about HTTP response codes. What are those, you ask? Well, any time you access a page from your browser, the server that contains the page (or that you think contains the page) looks for the page and sends a numeric code back to your browser. If everything goes alright, the server sends the code 200 back to you and the page is displayed. If the page isn't found, the server sends a 404 code back. That's why page-not-found errors are commonly called 404 errors. There are lots of different HTTP codes, but you'll only need to make pages for a few of them:
400: Bad request. The server can't understand the request you're sending. This is rarely seen (hopefully).
401: Authorization required. In order to access this page, you'll need a username and password.
403: Forbidden. The server was instructed to refuse your request.
404: Page not found. Our friend the 404 error. You'll use this page the most often.
408: Timeout. The request could not be completed in the time allowed for it. Your browser will usually automatically generate a message when this occurrs.
500: Internal server error. Something is misconfigured in the server. This is generally caused by problems with scripts or your .htaccess file.
Okay, now that you understand a little bit about what .htaccess can do, we're ready to start doing the grunt work. The first thing we're going to need to do is make our error page. You can either make a different page for each error or just have one standard error page. The choice is yours, but we're going to make a 404 error page in this tutorial. Go ahead and put some HTML on your page, and feel free to spice it up a little bit. In fact, do spice it up. Use the stylesheet that matches your site. Include a link to your home page. Post your email address so people can contact you if there's a problem. (If you're worried about spam bots, there are ways to obfuscate your email address.) Once your done, save your page as an HTML file. We're going to call ours error404.html and save it in the /errors directory.
Once you're done with that, it's time to do the magic. Open up the .htaccess file that you found/created earlier. If yours is premade, find some blank space at the bottom. Now, insert the following line of code:
ErrorDocument 404 /errors/error404.html
That's it! If you want to add more error documents, just add more ErrorDocument lines. The general format for the line is
ErrorDocument HTTP_error_number /path/to/errorpage.ext
If you want to be really fancy, you can use appropriately named CGI, PHP, ASP or other pages as your error page. Now, go type some random URLs to check your brand-spanking new error pages!
Want to learn more about .htaccess? Visit http://httpd.apache.org/docs/1.3/howto/htaccess.ht ml
About the author:
Eric Reif has seven years of experience with HTML and web design. He has recently begun to work increasingly more with CSS, JavaScript, Java, PHP, and mySQL and still has time to apply to college. He currently hosts his blog (which he admits is occasionally clever) at http://crazydrumguy.info, and he is beginning to update his website to include tutorials, downloadable scripts, and ot
|
|
|
|
|
|
Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of xml_set_object(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /mnt/web7/31/89/51742389/htdocs/html/rss3.php on line 37
in Web - Express.de Vicenza - Ein italienischer Pilot, der das schreckliche Unglück von Ramsein überlebt hat, ist bei Kunstflugübungen in ein Reihenhaus gerast. Er kam bei dem Unglück im ...
Dallas beendet Niederlagenserie - Der Spiegel Die Dallas Mavericks können doch noch gewinnen. Bei den New York Knicks reichte es nach fünf Niederlagen in Folge wieder einmal zu einem Sieg. Die Entscheidung fiel erst in der ...
Geheimdienste prophezeien Niedergang der USA - Der Spiegel Der Dollar verliert seine Rolle als Leitwährung, der Staat an politischer und wirtschaftlicher Macht - die US-Geheimdienste sehen für die Weltmacht USA eine so düstere Zukunft ...
Wappnen für den Wahlkampf im Web 2.0 - Derwesten.de Am Anfang stand eine Vermutung, erzählt der Polit-Blogger und Netz-Experte Markus Beckedahl: Deutsche Politik im Web 2.0 - da passiert nicht viel. Es gab nur kaum belastbare ...
Web-Portal für jugendliche Mukoviszidosepatienten - Ärtze Zeitung HEIDELBERG (mm). Ein neues Internetportal für jugendliche Patienten, die an Mukoviszidose erkrankt sind, hat jetzt das Zentrum für Kinder- und Jugendmedizin am Uniklinikum ...
|