all repos — h3rald @ e0c63b05fe72e1d0e0488341d1ce29a3a0b39e14

The sources of https://h3rald.com

Added .htaccess file.
h3rald h3rald@h3rald.com
Sun, 09 Aug 2009 13:09:56 +0200
commit

e0c63b05fe72e1d0e0488341d1ce29a3a0b39e14

parent

907f65f173dfa297b6ea1df8f59f04b514a09cd5

2 files changed, 80 insertions(+), 9 deletions(-)

jump to
A resources/.htaccess

@@ -0,0 +1,66 @@

+# Don't show directory listings for URLs which map to a directory. +Options -Indexes + +# Follow symbolic links in this directory. +Options +FollowSymLinks + +# Make Drupal handle any 404 errors. +ErrorDocument 404 /404/index.html + +# Force simple error message for requests for non-existent favicon.ico. +<Files favicon.ico> + ErrorDocument 404 "The requested file favicon.ico was not found." +</Files> + +# Set the default handler. +DirectoryIndex index.html + + + +# Requires mod_expires to be enabled. +<IfModule mod_expires.c> + # Enable expirations. + ExpiresActive On + + # Cache all files for 2 weeks after access (A). + ExpiresDefault A1209600 + + # Do not cache dynamically generated pages. + ExpiresByType text/html A1 +</IfModule> + +# Various rewrite rules. +<IfModule mod_rewrite.c> + RewriteEngine on + + # If your site can be accessed both with and without the 'www.' prefix, you + # can use one of the following settings to redirect users to your preferred + # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option: + # + # To redirect all users to access the site WITH the 'www.' prefix, + # (http://example.com/... will be redirected to http://www.example.com/...) + # adapt and uncomment the following: + # RewriteCond %{HTTP_HOST} ^example\.com$ [NC] + # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] + # + # To redirect all users to access the site WITHOUT the 'www.' prefix, + # (http://www.example.com/... will be redirected to http://example.com/...) + # uncomment and adapt the following: + # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] + # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301] + + # Modify the RewriteBase if you are using Drupal in a subdirectory or in a + # VirtualDocumentRoot and the rewrite rules are not working properly. + # For example if your site is at http://example.com/drupal uncomment and + # modify the following line: + # RewriteBase /drupal + # + # If your site is running in a VirtualDocumentRoot at http://example.com/, + # uncomment the following line: + # RewriteBase / + + RewriteRule ^$ /home/index.html [L,QSA] +</IfModule> + + +
M tasks/site.raketasks/site.rake

@@ -25,21 +25,26 @@ end

task :copy_files do pwd = Pathname.new Dir.pwd + copy_f = lambda do |src| + if src.file? then + rel_path = src.relative_path_from(pwd/'resources').to_s + dst = Pathname.new(pwd/"output/#{rel_path}") + if !dst.exist? || dst.exist? && !FileUtils.cmp(dst.to_s, src.to_s) then + dst.parent.mkpath + FileUtils.cp src.to_s, dst.to_s + puts "Copied '#{src}'." + end + end + end file_dirs = [Pathname.new(pwd/'resources/images'), Pathname.new(pwd/'resources/js'), Pathname.new(pwd/'resources/css'), Pathname.new(pwd/'resources/data')] + files = [pwd/'resources/.htaccess'] + files.each { |f| copy_f.call f } file_dirs.each do |d| d.find do |src| - if src.file? then - rel_path = src.relative_path_from(pwd/'resources').to_s - dst = Pathname.new(pwd/"output/#{rel_path}") - if !dst.exist? || dst.exist? && !FileUtils.cmp(dst.to_s, src.to_s) then - dst.parent.mkpath - FileUtils.cp src.to_s, dst.to_s - puts "Copied '#{src}'." - end - end + copy_f.call src end end end