It's possible to do this, but only if the RewriteRule
is specified in a per-server context, which means that you have to be able to edit the configuration for your VirtualHost
or the server in general (httpd.conf
). In this case, the rule you have would work fine.
Defining the rule in .htaccess
doesn't work, because this occurs in the fixup phase of Apache's request processing, which is after Apache tries to map the request to the filesystem (and therefore after Apache errors out the request). If you don't have access to the necessary configuration files, the most obvious workaround for this would to simply not pass the http://
scheme as part of the URL.
Your rule would still work, but because of how mod_rewrite
works in a per-directory context, you should probably condition it as well to prevent a redirect loop (the L
and explicit capture group are also unnecessary):
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ /test.php?domain=$0
As far as downforeveryoneorjustme.com
goes, it's running on the Google Frontend server, which is reportedly a modified version of Apache (though I didn't do much checking into this myself), so I imagine they've gone with the first option, or have some entirely different system; I'm not sure.