The RewriteCond %{REQUEST_URI} ^/(.+)$
matches all characters after the /
(.+)
is a regular expression that matches any character.
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(\s+)$[a-zA-Z0-9\/-]+$
RewriteRule /(.*) http://archived.example.com/$1
The above might do it, but I'm not very good with regular expressions.
(\s+)[a-zA-Z0-9\/-]+
will match a series of any non-whitespace character. Thinking about this now,of the above probably wouldn't work because it'll matchcharacters in the domain name afterbrackets following the trailing \/
.
I use RegExLib as my cheat-sheet. I've looked around there forIt'll also let you test regular expressions against a solution to your question, but haven't found anything...source But, I've answered your first question! "Why is this mod_rewrite redirecting my domain?"
I'll have another look after I eat(to see what matches).