htaccess redirect index.php to root (including subdomains)
Do this: RewriteCond %{THE_REQUEST} ^.*/index\.php RewriteRule ^(.*)index.php$ /$1 [R=301,L]
Do this: RewriteCond %{THE_REQUEST} ^.*/index\.php RewriteRule ^(.*)index.php$ /$1 [R=301,L]
There are a few Lua-based webservers around: Xavante seems to be the most popular. Haserl is nice and small. Nanoki is not strictly a webserver, but a nice small pure Lua wiki engine worth studying. As for the Lua wikies, there is also Sputnik, which is fully featured and very flexible, but is a bit … Read more
Some RewriteRule should handle that quite well. In a Drupal configuration file I found: # AddEncoding allows you to have certain browsers uncompress information on the fly. AddEncoding gzip .gz #Serve gzip compressed CSS files if they exist and the client accepts gzip. RewriteCond %{HTTP:Accept-encoding} gzip RewriteCond %{REQUEST_FILENAME}\.gz -s RewriteRule ^(.*)\.css $1\.css\.gz [QSA] # Serve … Read more
If you’re using MAMP 3 or 4 the instructions are slightly different. Here’s what worked for me, starting from a fresh install of MAMP 3.0.5 on Mavericks without Pro. Update: Still works on Yosemite after fixing Apache as described in this answer. Further Update: Comments suggest this still works at least through MAMP 5.4. Generate … Read more
You can use the RewriteRule flag S|skip to tie multiples RewriteRules to a single RewriteCond (or to a set of RewriteConds). Here is an example that applies one Cond to three Rules: RewriteCond %{HTTP_HOST} !^www.mydomain.com$ # skip rules if NOT within domain – only way to tie multiple rules to one cond RewriteRule .? – … Read more
The new version 2.4 of Apache HTTP Server has a module called mod_proxy_wstunnel which is a websocket proxy. http://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html
Using SetEnvIf, you can create a variable when the request starts with some path, then use the Satisfy Any directive to avoid having to login. # set an environtment variable “noauth” if the request starts with “/callbacks/” SetEnvIf Request_URI ^/callbacks/ noauth=1 # the auth block AuthName “Please login.” AuthGroupFile /dev/null AuthType Basic AuthUserFile /xxx/.htpasswd # … Read more
A pros/cons comparison for those modules exists on http://blog.jboss.org/ mod_proxy * Pros: o No need for a separate module compilation and maintenance. mod_proxy, mod_proxy_http, mod_proxy_ajp and mod_proxy_balancer comes as part of standard Apache 2.2+ distribution o Ability to use http https or AJP protocols, even within the same balancer. * Cons: o mod_proxy_ajp does not … Read more
Syntax check To check configuration files for syntax errors: # Red Hat-based (Fedora, CentOS), Arch-based and OSX httpd -t # Debian-based (Ubuntu) apache2ctl -t # MacOS apachectl -t List virtual hosts To list all virtual hosts, and their locations: # Red Hat-based (Fedora, CentOS), Arch-based and OSX httpd -S # Debian-based (Ubuntu) apache2ctl -S # … Read more
File extensions for cryptographic certificates aren’t really as standardized as you’d expect. Windows by default treats double-clicking a .crt file as a request to import the certificate into the Windows Root Certificate store, but treats a .cer file as a request just to view the certificate. So, they’re different in the sense that Windows has … Read more