you are in: codestackercodes [RSS] → tag: apache [RSS]

list all apache loaded modules Delicious Email

show/hide lines
   1  apache2ctl -t -D DUMP_MODULES
created by leozera — 04 November 2011 — get a short url — tags: apache embed

.htaccess examples Delicious Email

show/hide lines
   1  RewriteEngine On 
   2  RewriteCond %{REQUEST_FILENAME} !-f 
   3  RewriteCond %{REQUEST_FILENAME} !-d 
   4  RewriteRule ^(.*)$ $1.php [L,QSA] 
   5  # http://domain/about -> http://domain/about.php 
   6  
   7  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] 
   8  # http://domain/about -> http://domain/index.php?q=about 
created by leozera — 07 November 2010 — get a short url — tags: .htaccess apache embed

force download .htaccess Delicious Email

show/hide lines
   1  AddType application/octet-stream .doc .mov .avi .pdf .xls .mp4
created by leozera — 22 August 2009 — get a short url — tags: .htaccess apache htaccess embed

redirects "www.site.com" to "site.com" with .htaccess Delicious Email

show/hide lines
   1  RewriteCond %{HTTP_HOST} ^www.(.*) 
   2  RewriteRule ^(.*) http://%1/$1 [L,R=301] 
created by leozera — 14 December 2008 — get a short url — tags: .htaccess apache embed

generating a .htpasswd file Delicious Email

show/hide lines
   1  htpasswd -bc .htpasswd user pass 
created by leozera — 18 November 2008 — get a short url — tags: .htpasswd apache embed

Password protecting your pages with htaccess Delicious Email

create a .htaccess file with this content.

the .htpasswd contains a user and encrypted password (e.g.: leo:4tHAiRmQ4OpjM). create a encrypted password in: http://www.kxs.net/support/htaccess_pw.html

show/hide lines
   1  AuthUserFile /home/leonardo/public_html/project/.htpasswd
   2  AuthGroupFile /dev/null
   3  AuthName "Restricted Access"
   4  AuthType Basic
   5  <limit GET>
   6  require valid-user
   7  </limit>
created by leozera — 16 July 2008 — get a short url — tags: apache htaccess embed

activing php_auth on dreamhost Delicious Email

by default, dreamhost runs php as cgi.
the follow line switchs from cgi to apache module execution, supporting php_auth.

show/hide lines
   1  // create a .htaccess with this: 
   2  AddHandler application/x-httpd-php .php
created by anonymous — 04 July 2008 — get a short url — tags: apache dreamhost htaccess php embed