background preloader

10 useful .htaccess snippets to have in your toolbox

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. 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)/? Source: Create custom error pages Force download of specific files Related:  celikgrapix-_-

30 Useful Responsive Web Design Tutorials So we’ve reached the end of our “Responsive Web Design week”, tonight’s post will be the last of the series. We are going all out to help you hone your skills in manipulating those codes to respond at will when displayed on different devices. And to do this, we are featuring 30 Responsive Web Design Tutorials found online. We’ll start off with introductory tutorials in ‘Breaking the Ice’, something like an RWD: 101 class you should attend to get the hang of the concept before we move on to ‘Start Building’ exercises. Lastly we’ll end with a ‘Do More’ section in which we’ll feature tutorials that play with horizontal layouts, ‘elastic’ videos, drop-down menus and slide-to-top accordion navigations, thumbnails and the sticky issue with tables. But first… Here’s a recap of the two tutorials that were featured earlier this week by our authors: Responsive website Navigation By Thoriq Firdaus – [View tutorial] Here’s a tutorial to help you make your very own responsive website navigation. Do More

Apache Lucene - Apache Lucene Core Apache LuceneTM is a high-performance, full-featured text search engine library written entirely in Java. It is a technology suitable for nearly any application that requires full-text search, especially cross-platform. Apache Lucene is an open source project available for free download. Lucene offers powerful features through a simple API: Scalable, High-Performance Indexing over 150GB/hour on modern hardwaresmall RAM requirements -- only 1MB heapincremental indexing as fast as batch indexingindex size roughly 20-30% the size of text indexed Powerful, Accurate and Efficient Search Algorithms Cross-Platform Solution Available as Open Source software under the Apache License which lets you use Lucene in both commercial and Open Source programs100%-pure JavaImplementations in other programming languages available that are index-compatible The Apache Software Foundation The Apache Software Foundation provides support for the Apache community of open-source software projects.

Welcome — CakePHP Cookbook v2.x documentation Apache HTTP Server Project How a Simple Layout Can Be Mixed ‘n’ Matched with Patterns, Photos and Backgrounds It's pretty amazing how much colour and background can change the look and feel of a website. In this tutorial we're going to put together a quick, simple but effective layout and then create variations using backgrounds, photos and patterns. We'll also look at how to make seamless tiled backgrounds out of a photo, methods for ending a single photo and simple ways to create pixel patterns. Step 1 - Creating the Basic Layout So our first task is to design a layout for our page. Now I should point out in reality I didn't actually draw out this set of boxes quite like this. Step 2 - Fleshing it out So that layout is our bones, now we need to flesh it out with some dummy content and a colour scheme. As you can see I haven't done anything really amazing here, just placed the elements on the page fairly neatly and evenly. Note that these are just rough guides and I actually just work by eye until things look right. Finally I've used a warm, earthy tones colour palette. View Before and After

Apache Tomcat Adding Custom Google Maps to Your Website | Stiern Maps are often placed on a company website to help customers find their way there. For that, Google Maps is excellent. But wouldn’t it be nice to add your company logo, parking lots, train stations, etc. to the map, to help the customer even more? It is very simple, and in this article I am going to show you how. Before we start, check out what we are going to create: Now, here is an overview: Overview Google Maps API The Google Maps API allows you to embed maps directly into your website. Getting the Coordinates As I do not expect you to know the precise coordinates of your location, I will explain a very quick way Google has provided to do this. When you enter this in your address bar, you will see this: The coordinates of Apple's head quarter in Cupertino The first number is the status code, and 200 means that everything is okay. Adding the Map to Your Website There’s no need to hesitate – let’s add that map to your website! After the URL, you will notice sensor=false. Write Adding Markers

Apache Virtual Host documentation - Apache HTTP Server Version 2.4 The term Virtual Host refers to the practice of running more than one web site (such as company1.example.com and company2.example.com) on a single machine. Virtual hosts can be "IP-based", meaning that you have a different IP address for every web site, or "name-based", meaning that you have multiple names running on each IP address. The fact that they are running on the same physical server is not apparent to the end user. Apache was one of the first servers to support IP-based virtual hosts right out of the box. Versions 1.1 and later of Apache support both IP-based and name-based virtual hosts (vhosts). The latter variant of virtual hosts is sometimes also called host-based or non-IP virtual hosts. Below is a list of documentation pages which explain all details of virtual host support in Apache HTTP Server: Configuration directives If you are trying to debug your virtual host configuration, you may find the Apache -S command line switch useful. /usr/local/apache2/bin/httpd -S

Tweet! A simple jQuery widget plugin to put Twitter on your site Apache HTTP Server Tutorial: .htaccess files - Apache HTTP Server Version 2.4 .htaccess files provide a way to make configuration changes on a per-directory basis. .htaccess files You should avoid using .htaccess files completely if you have access to httpd main server config file. What they are/How to use them .htaccess files (or "distributed configuration files") provide a way to make configuration changes on a per-directory basis. Note: If you want to call your .htaccess file something else, you can change the name of the file using the AccessFileName directive. AccessFileName ".config" In general, .htaccess files use the same syntax as the main configuration files. For example, if you look at the documentation for the AddDefaultCharset directive, you will find that it is permitted in .htaccess files. If you are unsure whether a particular directive is permitted in a .htaccess file, look at the documentation for that directive, and check the Context line for ".htaccess". When (not) to use .htaccess files The first of these is performance. AddType text/example ".exm"

Sass - Syntactically Awesome Stylesheets Before you can use Sass, you need to set it up on your project. If you want to just browse here, go ahead, but we recommend you go install Sass first. Go here if you want to learn how to get everything setup. Security Tips - Apache HTTP Server Version 2.4 Some hints and tips on security issues in setting up a web server. Some of the suggestions will be general, others specific to Apache. Keep up to Date The Apache HTTP Server has a good record for security and a developer community highly concerned about security issues. But it is inevitable that some problems -- small or large -- will be discovered in software after it is released. Of course, most times that a web server is compromised, it is not because of problems in the HTTP Server code. Denial of Service (DoS) attacks All network servers can be subject to denial of service attacks that attempt to prevent responses to clients by tying up the resources of the server. Often the most effective anti-DoS tool will be a firewall or other operating-system configurations. There are also certain Apache HTTP Server configuration settings that can help mitigate problems: The RequestReadTimeout directive allows to limit the time a client may take to send the request. Server Side Includes

Responsive Measure: A jQuery plugin for responsive typography Responsive Measure is a simple script that allows you to pass in a selector (ideally the container where your primary content will go) which generates the ideal font size needed to produce the ideal measure for your text. It also has the ability to generate a resolution independent font-scale based on the ideal font-size. $(document).on('responsiveMeasureUpdated', function(e, data) { $('.giga').css('fontSize', data.fontRatios[9] + 'px'); $('h1').css('fontSize', data.fontRatios[8] + 'px'); $('h2').css('fontSize', data.fontRatios[7] + 'px'); $('h3').css('fontSize', data.fontRatios[6] + 'px'); $('p').css('fontSize', data.fontRatios[5] + 'px'); $('.sm').css('fontSize', data.fontRatios[4] + 'px'); }); Check out the examples to see the plugin in action.

Related: