Pages

Subscribe

Ultimate htaccess Examples

Here's my list of the ultimate htaccess code snippets and examples that I use all the time. I tried to keep them extremely minimalistic. Don't miss checking out this example htaccess file, its very comprehensive Heres the actual code that I use when I'm developing sites for clients This lets google crawl the page, lets me access the whole site (24.205.23.222) without a password, and lets my client access the page WITH a password. It also allows for XHTML and CSS validation! (w3.org) # ELITE HTACCESS FOR WEBDEVELOPERS ############################################## AuthName "SiteName Administration" AuthUserFile /home/sitename.com/.htpasswd AuthType basic Require valid-user Order deny,allow Deny from all Allow from 24\.205\.23\.222 Allow from w3.org htmlhelp.com Allow from googlebot.com Satisfy...

.htaccess File and mod_rewrite examples

An attempt to create a default skeleton .htaccess file with the very best apache htaccess examples... Updated semi-frequently based on detailed info from the Apache htaccess tutorial. If you see any room for improvement, or if you can add something than go ahead and comment and I will definately give it a look for possible inclusion. NOTE: Check out and use the Google 404 Error Page. =============================================================================# MAIN SETTINGS AND OPTIONS =============================================================================# Options: ALL,FollowSymLinks,Includes,IncludesNOEXEC,SymLinksIfOwnerMatch ##########   ## MAIN DEFAULTS ### Options +ExecCGI -Indexes DirectoryIndex index.html index.htm index.php DefaultLanguage en-US AddDefaultCharset...

How To Use .htaccess 301 Redirect

Using .htaccess to redirect your visitors from one page to another is the cleanest fastest way of making a redirect. This is the same method I use to redirect readers of this blog from DavePit.com to DavidPitlyuk.com. I do this because DavidPitlyuk.com may be too hard to spell, so I added DavePit.com which is easy, and added a simple re-direct to move the readers over to the correct domain.You can use .htaccess to redirect entire domains, folders, specific files, and more. John Chow uses an .htaccess redirect to set his preferred domain, something that can better your site from an SEO standpoint. I’ll go over how to do this as well.Things To NoteKeep in mind that .htaccess is only supported on non-Windows servers, so any of you guys using Windows need to utilize another method to redirect...

How to use .htaccess

introduction to .htaccessThere’s a good reason why you won’t see .htaccess files on the web; almost every web server in the world is configured to ignore them, by default. Same goes for most operating systems. Mainly it’s the dot “.” at the start, you see?If you don’t see, you’ll need to disable your operating system’s invisible file functions, or use a text editor that allows you to open hidden files, something like bbedit on the Mac platform. On windows, showing invisibles in explorer should allow any text editor to open them, and most decent editors to save them too**. Linux dudes know how to find them without any help from me.Mac Finder view with invisible filesthat same folder, as seen from Mac OS XIn both images, the operating system has been instructed to display invisible files. ugly,...

Tips and Examples for how to use your .htaccess file

.htaccess file explained with examples for eliminating referrer spam and deep linkingSomeone recently asked how to block a particular IP address from theirweb site. the .htaccess file is a good way to do this. I’m assumingthat you can google for information about where to put your .htaccessfile, and am only going to address some ways to populate your .htaccessfile to accomplish some routine access control and URL rewriting.For more information on URL rewriting do a google search for:+mod_rewrite +documentationor+mod_rewrite +examplesTopics covered are: * A brief introduction to Regular Expressions * Denying access based on IP address of browser * Denying access based on HTTP_REFERER * Denying linking or deep linking of images on your site * Sending naughty users to “good” content...

Others htaccess Trick

The Apache Web server provides a feature called .htaccess file, which provides commands to control a Web site. This file is simply a text file containing Apache directives. Those directives apply to the documents in the directory where the file is located, and to all subdirectories under it as well. Other .htaccess files in subdirectories may change or nullify the effects of those in parent directories.You have to be careful when editing .htaccess files, as a small mistake can make your Web site stop working. You should immediately test the site to be sure it works.You can use any text editor to create or make changes to .htaccess files. Keep in mind that commands in these files should be placed on one line only, so if your text editor uses word-wrap, make sure it's disabled. Be sure .htaccess...

Superb htaccess Tricks

General Information.htaccess Definition1Apache server software provides distributed (i.e., directory-level) configuration via Hypertext Access files. These .htaccess files enable the localized fine-tuning of Apache’s universal system-configuration directives, which are defined in Apache’s main configuration file. The localized .htaccess directives must operate from within a file named .htaccess. The user must have appropriate file permissions to access and/or edit the .htaccess file. Further, .htaccess file permissions should never allow world write access — a secure permissions setting is “644”, which allows universal read access and user-only write access. Finally, .htaccess rules apply to the parent directory and all subdirectories. Thus to apply configuration rules to an entire website,...