background preloader

Technos

Facebook Twitter

10 useful .htaccess snippets to have in your toolbox. .htaccess, the file which control the Apache webserver, is very useful and allows you to do a lot of things. In this article, I have compiled 10 .htaccess snippets that any web developer should have in his toolbox. Before editing your .htaccess file, always make a backup so you can restore it if needed. Remove www in url For SEO reasons, you might always remove (or use) the www prefix in your urls. The following snippet will remove the www from your website url and redirect any url with the www to the non-www version. RewriteEngine On RewriteCond %{HTTP_HOST} ! Source: Prevent hotlinking Hotlinking is a bad practice that consist of using the images from another site on yours. Source: Redirect all WordPress feeds to feedburner Most bloggers are using Feedburner, a web service that lets you know how many people are reading your blog via feeds.

<IfModule mod_alias.c> RedirectMatch 301 /feed/(atom|rdf|rss|rss2)/? Create custom error pages. PHP5 WebSocket Example – A Simple Chat | BOHUCO. The classic example for websockets is a chat. This chat example has only 200 lines of code (excl. the Websocket class), is really easy to understand and customizable. The WebSocket class takes a function (or class method) as callback for every socket action, for this example i use the process method of the WebsocketChat Class: The WebsocketChat Class handles user actions and messages. We have two actions: ‘login’ and ‘chat’. ‘login’ happens when a new user sets his username, ‘chat’ is always when a user sends a new message: On the client-side we have to send the right actions if someone clicks ‘login’ or ‘send message’. The login action adds a new chat user to the user-array and loads the last five messages for this new user. If the ‘chat’ action is called then add a new WebsocketChatMessage to the message array and send it to all current chat-users: The WebsocketChatMessage is just a container-class for holding the message data: View Chat Example on BOHUCO Labs View server.php Code.

ThinkUp: Social Media Insights Engine. What To Do When Your Website Goes Down - Smashing Magazine. Advertisement Have you ever heard a colleague answer the phone like this: “Good afterno… Yes… What? Completely? … When did it go down? … Really, that long? … We’ll look into it right away… Yes, I understand… Of course… Okay, speak to you soon… Bye.” An important website has gone down, and sooner or later, heads will turn to the Web development corner of the office, where you are sitting quietly, minding your own business, regretting that you ever mentioned “Linux” on your CV. 1. Don’t take your client’s word for it. If it fails, then visit a robust website, such as google.com or bbc.co.uk.

If the website is definitely down, then frown confusedly and keep reading. 2. A website can appear to have gone down mainly for one of the following reasons: A programming error on the website,A DNS problem, or an expired domain,A networking problem,Something on the server has crashed,The whole server has crashed. Otherwise, you’ll need to run some commands to determine the cause. 3. On Windows: 4. 5. 6. HTML5 Recipes: More on Geolocation - InsideRIA. Quick Feedback Form w/ PHP and jQuery. Martin Angelov When releasing a web product, there is nothing more beneficial than receiving early feedback from your users. Unfortunately, many websites make it unnecessarily difficult to send your feedback or lack this functionality altogether Today we are making a simple solution to this problem. Powered by jQuery, PHP and the PHPMailer class, this form sends the users’ suggestions directly to your mailbox.

The HTML Lets start with the HTML markup. Feedback.html <! Inside the body you can see the #feedback div. Inside it reside the five color spans. Lastly is the .section container, which holds the heading, the textarea and the button. Quick Feedback Form w/ PHP & jQuery The CSS Moving on to the styling of the form, we first have to say a couple of words about how the stylesheet is structured. Styles.css – Part 1 The first element to be styled is the #feedback div. At the bottom are the CSS rules which define the looks of the textarea. styles.css – Part 2 Sending an AJAX Request The jQuery. DD_belatedPNG: Medicine for your IE6/PNG headache! 2011/4/8: This is no longer an actively maintained project. I apologize, I must move on with current events. This is a Javascript library that sandwiches PNG image support into IE6 without much fuss.

You can use PNGs as the SRC of an <IMG/> element or as a background-image property in CSS. If you attempt the latter, you will find that, unlike with vanilla usage of AlphaImageLoader, background-position and background-repeat work as intended. As a bonus, "fixed" elements will respond to a commonly used set of Javascript style assignments, as well as the A:hover pseudo-class. Table of Contents Long story short, this uses Microsoft's implementation of VML instead of Microsoft's AlphaImageLoader filter. The intended implementation is pretty easy: Download a copy of the DD_belatedPNG Javascript file - please do not hotlink mine, I am on a shared host.

Due to popular demand, here is some documentation for how to "fix" elements on a pick-and-choose basis. (Based on the normal usage approach) Anti-Spam - Prémunissez-vous contre les « spammeurs » | bulk unsolicited unwanted junk email. 50+ PHP optimisation tips revisited. Share photos on Twitter. David Bloom - CSS hack for IE8 Standards Mode. Un tutoriel de la mise en cache pour les auteurs Web et les webmestres. Pour les auteurs Web et les webmestres Ce document est informatif.

Bien que de nature technique, il essaye de rendre les concepts mis en jeu compréhensibles et applicables à des situations concrètes. Pour cette raison, certains aspects de la documentation sont simplifiés ou omis, par souci de clarté. Si votre intérêt sur le sujet vous porte aux détails, veuillez explorer le chapitre « Références et autres informations » à la fin. Qu’est-ce qu’un cache Web ? À quoi servent-ils ? Un cache Web se tient entre un ou plusieurs serveurs Web (appelés aussi serveurs originaux) et un ou plusieurs clients, et il observe le va-et-vient des requêtes en enregistrant pour lui-même des copies des réponses — comme des pages HTML, des images et des fichiers (appelés collectivement des représentations). On utilise des caches Web pour deux raisons principales : Les types de cache Web Les caches de navigateurs Les caches de serveurs mandataires Les caches de passerelles Comment fonctionnent les caches Web.