You get a 500 error because you're causing the server to enter an infinite loop (which it gets angry about, and throws an error to stop).
This is because of your RewriteRule
, which will always match:
RewriteRule ^(.*)$ versions/0/1/$1
^(.*)$
matches the value versions/0/1/
, so after you perform the initial rewrite, the rule set is re-evaluated and creates a cycle that looks like this:
versions/0/1/something
versions/0/1/versions/0/1/something
versions/0/1/versions/0/1/versions/0/1/something
..and so on.
You should condition your RewriteRule
to prevent the looping, perhaps as follows:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/versions
RewriteRule ^(.*)$ versions/0/1/$1
Also, your ErrorDocument 500
statement doesn't make much sense, as you will never generate a 500 error because you don't have mod_rewrite
enabled, since you've surrounded the relevant mod_rewrite
directives with <IfModule mod_rewrite.c>
.