User Tools

Site Tools


software:webdesign:htaccess

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
software:webdesign:htaccess [2011/05/15 19:25] – [htaccess Cheatsheet] superwizardsoftware:webdesign:htaccess [2017/10/13 04:59] (current) superwizard
Line 1: Line 1:
 +======  Htaccess → THE Ultimate Htaccess ======
 +
 +From: https://www.askapache.com/htaccess/
 +
 +<code>
 +Specifically, .htaccess is the default file name of a special configuration file that provides a number of directives (commands) for controlling and configuring the Apache Web Server, and also to control and configure modules that can be built into the Apache installation, or included at run-time like mod_rewrite (for htaccess rewrite), mod_alias (for htaccess redirects), and mod_ssl (for controlling SSL connections).
 +
 +Htaccess allows for decentralized management of Web Server configurations
 +</code>
 +
 +
 +====== For setting up https SSL access for a website Drupal in particular ======
 +
 +[[service:ssl|Service SSL]]
 +
 +
 ====== What Can it Do ====== ====== What Can it Do ======
  
Line 17: Line 33:
  
  
-.htaccess is most often used to restrict or deny access to individual files and folders. A typical example would be an "includes" folder. Your site's pages can call these included scripts all they like, but you don't want users accessing these files directly, over the web. In that case you would drop an .htaccess file in the includes folder with content something like this..+====== Access control ====== 
 + 
 +http://httpd.apache.org/docs/2.3/upgrading.html 
 + 
 +In 2.2, access control based on client hostname, IP address, and other characteristics of client requests was done using the directives Order, Allow, Deny, and Satisfy. 
 + 
 +**In 2.4, such access control is done in the same way as other authorization checks, using the new module mod_authz_host. The old access control idioms should be replaced by the new authentication mechanisms, although for compatibility with old configurations, the new module mod_access_compat is provided.** 
 + 
 +Order Directive 
 + 
 +http://httpd.apache.org/docs/2.3/mod/mod_access_compat.html#order 
 + 
 +**Ordering is one of:** 
 + 
 +**Allow,Deny** 
 +First, all Allow directives are evaluated; at least one must match, or the request is rejected.  
 +Next, all Deny directives are evaluated. If any matches, the request is rejected.  
 +Last, any requests which do not match an Allow or a Deny directive are denied by default. 
 +**Deny,Allow** 
 +First, all Deny directives are evaluated; if any match, the request is denied  
 +unless it also matches an Allow directive.  
 +Any requests which do not match any Allow or Deny directives are permitted. 
 +**Mutual-failure** 
 +This order has the same effect as Order Allow,Deny and is deprecated in its favor. 
 + 
 +.htaccess is most often used to restrict or deny access to individual files and folders.  
 +A typical example would be an "includes" folder. Your site's pages can call these included scripts all  
 +they like, but you don't want users accessing these files directly, over the web. In that case you  
 +would drop an .htaccess file in the includes folder with content something like this..
  
     NO ENTRY!     NO ENTRY!
-    <code>+<code>
     # no one gets in here!     # no one gets in here!
     deny from all     deny from all
-    </code>+</code>
  
 Order the processing of the allow and deny directives Order the processing of the allow and deny directives
Line 32: Line 76:
 order allow,deny order allow,deny
 </code> </code>
 +
 +Satisfy Directive
 +
 +http://httpd.apache.org/docs/2.3/mod/mod_access_compat.html#satisfy
  
 <code> <code>
software/webdesign/htaccess.1305487519.txt.gz · Last modified: by superwizard