PDA

View Full Version : Reference links about .htaccess/.htpasswd/rewriting


chreo
09-15-2009, 11:00 PM
Hi there!
Collected these links from the forum;
I thought they might make a nice Sticky
(first thing I look for when entering a new forum) ;)

.htaccess syntax
http://www.regular-expressions.info/

ErrorDocument
http://httpd.apache.org/docs/2.0/mod/core.html#errordocument

.htaccess etc
http://www.cafewebmaster.com/redirect-webpages-html-php-htaccess-javascript-cgi-perl-aspnet-and-coldfusion

Where to find Apache.org How-To/Tutorials
http://httpd.apache.org/docs/trunk/

Another forum with lots of posts on .htaccess, mod_rewrite etc
http://www.webmasterworld.com/apache/

.htaccess redirect
http://www.askapache.com/apache/mod_rewrite-tips-and-tricks.html#external-redirect-php-files-to-html

http://corz.org/serv/tricks/htaccess2.php

.htaccess Clean up URLs
http://www.addedbytes.com/apache/url-rewriting-for-beginners/

.htaccess rewrite to block robots
http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide.html#blocking-of-robots

.htaccess How to make search ignore upper/lower case
http://httpd.apache.org/docs/2.0/mod/mod_speling.html

.htaccess URL rewriting guide
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

.htaccess rewrite
http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide.html

mod_rewrite
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
http://httpd.apache.org/docs/2.0/rewrite/
http://httpd.apache.org/docs/2.2/rewrite/

URL Rewriting Engine
http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html

.htaccess set character encoding
http://httpd.apache.org/docs/2.2/mod/core.html#adddefaultcharset

.htaccess rewrite URL with query-string
http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html#check-for-key-in-query-string

article about mod_rewrite
http://www.workingwith.me.uk/articles/scripting/mod_rewrite

.htaccess rewrite excepting specified files
http://framework.zend.com/wiki/display/ZFDEV/Configuring+Your+URL+Rewriter

.htaccess blocking ip from certain countries
http://www.maxmind.com/app/mod_geoip


.htpasswd
http://javascriptkit.com/howto/htaccess3.shtml
http://httpd.apache.org/docs/2.0/howto/auth.html

BarrMan
09-17-2009, 08:34 PM
http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/

Helped me a lot.

MiaLye
03-08-2010, 08:55 AM
.htaccess blocking ip from certain countries
http://www.maxmind.com/app/mod_geoip

You left out the important one:

IP2Location Block Visitors by Country
http://www.ip2location.com/blockvisitorsbycountry.aspx

and

http://www.blockacountry.com/

snushah
02-14-2011, 01:48 PM
Important setting on .HTACCESS


AuthType Basic
AuthName ""
Order deny,allow
Require user
Require group
Allow from
Deny from
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} [NC]
RewriteRule ^$ [L]

RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[345].*Gecko*
RewriteRule ^$ [L]

RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[345].*MSIE*
RewriteRule ^$ [L]

RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[12].* [OR]
RewriteCond %{HTTP_USER_AGENT} ^Lynx/*
RewriteRule ^$ [L]

RewriteRule ^$ [L]

RewriteRule http/cm/(.*) /$1 [PT]
ErrorDocument 400
ErrorDocument 401
ErrorDocument 403
ErrorDocument 404
ErrorDocument 500
DirectoryIndex