I want to route all requests from http to https, after this route all requests which cause an 404 to route.php script.
But I don’t know, how to tell mod_rewrite to 1st use rule one, and then rule two?
My Rule looks like this:
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}/_playground/$1
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://localhost/_playground/route.php?to=$1
mod_rewrite follows the sequence of the rules:
ref here: http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
and you can use flags to further tuning your rules: http://httpd.apache.org/docs/2.2/rewrite/rewrite_flags.html