Guest User

.htaccess (subfolder)

a guest
Apr 21st, 2013
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.35 KB | None | 0 0
  1. #
  2. # Apache/PHP/Drupal settings:
  3. #
  4. suPHP_ConfigPath /home/my_account/public_html/my_subfolder
  5.  
  6. # Protect files and directories from prying eyes.
  7. <FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
  8. Order allow,deny
  9. </FilesMatch>
  10.  
  11. # Don't show directory listings for URLs which map to a directory.
  12. #Options -Indexes
  13.  
  14. # Follow symbolic links in this directory.
  15. # For security reasons, Option followsymlinks cannot be overridden.
  16. #Options +FollowSymLinks
  17. Options +SymLinksIfOwnerMatch
  18.  
  19. # Make Drupal handle any 404 errors.
  20. ErrorDocument 404 /index.php
  21.  
  22. # Force simple error message for requests for non-existent favicon.ico.
  23. <Files favicon.ico>
  24. # There is no end quote below, for compatibility with Apache 1.3.
  25. ErrorDocument 404 "The requested file favicon.ico was not found.
  26. </Files>
  27.  
  28. # Set the default handler.
  29. DirectoryIndex index.php
  30.  
  31. # Override PHP settings. More in sites/default/settings.php
  32. # but the following cannot be changed at runtime.
  33.  
  34. # PHP 4, Apache 1.
  35. <IfModule mod_php4.c>
  36. php_value magic_quotes_gpc 0
  37. php_value register_globals 0
  38. php_value session.auto_start 0
  39. php_value mbstring.http_input pass
  40. php_value mbstring.http_output pass
  41. php_value mbstring.encoding_translation 0
  42. </IfModule>
  43.  
  44. # PHP 4, Apache 2.
  45. <IfModule sapi_apache2.c>
  46. php_value magic_quotes_gpc 0
  47. php_value register_globals 0
  48. php_value session.auto_start 0
  49. php_value mbstring.http_input pass
  50. php_value mbstring.http_output pass
  51. php_value mbstring.encoding_translation 0
  52. </IfModule>
  53.  
  54. # PHP 5, Apache 1 and 2.
  55. <IfModule mod_php5.c>
  56. php_value magic_quotes_gpc 0
  57. php_value register_globals 0
  58. php_value session.auto_start 0
  59. php_value mbstring.http_input pass
  60. php_value mbstring.http_output pass
  61. php_value mbstring.encoding_translation 0
  62. </IfModule>
  63.  
  64. # Requires mod_expires to be enabled.
  65. <IfModule mod_expires.c>
  66. # Enable expirations.
  67. ExpiresActive On
  68.  
  69. # Cache all files for 2 weeks after access (A).
  70. ExpiresDefault A1209600
  71.  
  72. <FilesMatch \.php$>
  73. # Do not allow PHP scripts to be cached unless they explicitly send cache
  74. # headers themselves. Otherwise all scripts would have to overwrite the
  75. # headers set by mod_expires if they want another caching behavior. This may
  76. # fail if an error occurs early in the bootstrap process, and it may cause
  77. # problems if a non-Drupal PHP file is installed in a subdirectory.
  78. ExpiresActive Off
  79. </FilesMatch>
  80. </IfModule>
  81.  
  82. # Various rewrite rules.
  83. <IfModule mod_rewrite.c>
  84. RewriteEngine on
  85.  
  86. # If your site can be accessed both with and without the 'www.' prefix, you
  87. # can use one of the following settings to redirect users to your preferred
  88. # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  89. #
  90. # To redirect all users to access the site WITH the 'www.' prefix,
  91. # (http://example.com/... will be redirected to http://www.example.com/...)
  92. # adapt and uncomment the following:
  93. # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  94. # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  95. #
  96. # To redirect all users to access the site WITHOUT the 'www.' prefix,
  97. # (http://www.example.com/... will be redirected to http://example.com/...)
  98. # uncomment and adapt the following:
  99. # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  100. # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
  101.  
  102. # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  103. # VirtualDocumentRoot and the rewrite rules are not working properly.
  104. # For example if your site is at http://example.com/drupal uncomment and
  105. # modify the following line:
  106. # RewriteBase /drupal
  107. #
  108. # If your site is running in a VirtualDocumentRoot at http://example.com/,
  109. # uncomment the following line:
  110. # RewriteBase /
  111.  
  112. # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
  113. RewriteCond %{REQUEST_FILENAME} !-f
  114. RewriteCond %{REQUEST_FILENAME} !-d
  115. RewriteCond %{REQUEST_URI} !=/favicon.ico
  116. RewriteCond %{REQUEST_URI} !^/educadores/.*$
  117. RewriteCond %{REQUEST_URI} !^/js/.*$
  118. RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
  119.  
  120. <IfModule mod_headers.c>
  121. # Serve gzip compressed CSS/JS files if they exist and client accepts gzip.
  122. RewriteCond %{HTTP:Accept-encoding} gzip
  123. RewriteCond %{REQUEST_URI} (^/(.+)/advagg_(j|cs)s/(.+)\.(j|cs)s) [NC]
  124. RewriteCond %{REQUEST_FILENAME}\.gz -s
  125. RewriteRule ^(.*)\.(j|cs)s$ $1\.$2s\.gz [QSA]
  126.  
  127. # Serve correct content types, and prevent mod_deflate double gzip.
  128. RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
  129. RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]
  130.  
  131. <FilesMatch "\.(j|cs)s\.gz$">
  132. # Serve correct encoding type.
  133. Header set Content-Encoding gzip
  134. # Force proxies to cache gzipped & non-gzipped css/js files separately.
  135. Header append Vary Accept-Encoding
  136. </FilesMatch>
  137. </IfModule>
  138.  
  139.  
  140.  
  141. </IfModule>
  142.  
  143. # $Id$
  144. AddType video/x-flv flv
  145.  
  146. # AdvAgg Rules Start.
  147. <FilesMatch "^(j|cs)s_[0-9a-f]{32}_.+\.(j|cs)s(\.gz)?">
  148. # No mod_headers
  149. <IfModule !mod_headers.c>
  150. # No mod_expires
  151. <IfModule !mod_expires.c>
  152. # Use ETags.
  153. FileETag MTime Size
  154. </IfModule>
  155.  
  156. # Use Expires Directive.
  157. <IfModule mod_expires.c>
  158. # Do not use ETags.
  159. FileETag None
  160. # Enable expirations.
  161. ExpiresActive On
  162. # Cache all aggregated CSS/JS files for 480 weeks after access (A).
  163. ExpiresDefault A290304000
  164. </IfModule>
  165. </IfModule>
  166.  
  167. <IfModule mod_headers.c>
  168. # Set a far future Cache-Control header to 480 weeks.
  169. Header set Cache-Control "max-age=290304000, no-transform, public"
  170. # Set a far future Expires header.
  171. Header set Expires "Tue, 20 Jan 2037 04:20:42 GMT"
  172. # Pretend the file was last modified a long time ago in the past.
  173. Header set Last-Modified "Wed, 20 Jan 1988 04:20:42 GMT"
  174. # Do not use etags for cache validation.
  175. Header unset ETag
  176. </IfModule>
  177. </FilesMatch>
  178. # AdvAgg Rules End.
  179.  
  180. <Files 403.shtml>
  181. order allow,deny
  182. allow from all
  183. </Files>
  184.  
  185. deny from 64.27.3.214
Advertisement
Add Comment
Please, Sign In to add comment