.htaccess
.htaccess url-rewrite if file not exists
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^.*$ /default.php [L]
What is the correct mime-type for serving an iPhone .ipa file?
I voted up the other answers as they were both helpful, but this is what I ended up needing to fix the problem. AddType application/octet-stream .ipa <Files *.ipa> Header set Content-Disposition attachment </Files>
How can I fix the ‘Missing Cross-Origin Resource Sharing (CORS) Response Header’ webfont issue?
If you are just interested in the use of Access-Control-Allow-Origin:* You can do that with this .htaccess file at the site root. Header set Access-Control-Allow-Origin “*” Some useful information here: http://enable-cors.org/server_apache.html
.htaccess File Options -Indexes on Subdirectories
The correct answer is Options -Indexes You must have been thinking of AllowOverride All https://httpd.apache.org/docs/2.2/howto/htaccess.html .htaccess files (or “distributed configuration files”) provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and … Read more
Caching and gzip compression by htaccess
# 480 weeks <FilesMatch “\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$”> Header set Cache-Control “max-age=290304000, public” </FilesMatch> # 2 DAYS <FilesMatch “\.(xml|txt)$”> Header set Cache-Control “max-age=172800, public, must-revalidate” </FilesMatch> # 2 HOURS <FilesMatch “\.(html|htm)$”> Header set Cache-Control “max-age=7200, must-revalidate” </FilesMatch> <ifModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* … Read more
Use a subdirectory as root with htaccess in Apache 1.3
Finally got it, after a week of trying. RewriteRules really are voodoo… RewriteEngine On # Map http://www.example.com to /jekyll. RewriteRule ^$ /jekyll/ [L] # Map http://www.example.com/x to /jekyll/x unless there is a x in the web root. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^/jekyll/ RewriteRule ^(.*)$ /jekyll/$1 # Add trailing slash to directories … Read more
Send a 404 error via htaccess?
Try: RewriteRule ^directory/ – [L,R=404] This redirects all requests for the folder “/directory/“, they get a 404 response.