LoadModule mpm_prefork_module libexec/apache2/mod_mpm_prefork.so
LoadModule alias_module libexec/apache2/mod_alias.so
LoadModule unixd_module libexec/apache2/mod_unixd.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
LoadModule headers_module libexec/apache2/mod_headers.so
ServerRoot .
PidFile ./httpd.pid
RewriteEngine On
Listen 8888
<VirtualHost *:8888>
LogLevel debug
RedirectMatch 301 ^/part1/(.*)$ /part1-iter/$1/1
RewriteRule ^/part1-iter/(.)(.)(.)(.) - [E=C1:$1,E=C2:$2,E=C3:$3,E=C4:$4]
RewriteCond %{ENV:C1}
RewriteCond %{ENV:C1}
RewriteCond %{ENV:C1}
RewriteCond %{ENV:C2}
RewriteCond %{ENV:C2}
RewriteCond %{ENV:C3}
RewriteRule ^ - [E=ALL_PART1_CHARS_DISTINCT:1]
RewriteCond %{ENV:ALL_PART1_CHARS_DISTINCT} =1
RewriteRule ^/part1-iter/(.{4})[^/]*/(1+)$ /part1-complete/$1/111$2 [R=301,L]
RewriteCond %{ENV:ALL_PART1_CHARS_DISTINCT} !=1
RewriteRule ^/part1-iter/.([^/]+)/(1+)$ /part1-iter/$1/1$2 [R=301,L]
RedirectMatch 301 ^/part2/(.*)$ /part2-iter/$1/1
RewriteRule ^/part2-iter/(.)(.)(.)(.)(.)(.)(.)(.)(.) - [E=CC1:$1,E=CC2:$2,E=CC3:$3,E=CC4:$4,E=CC5:$5,E=CC6:$6,E=CC7:$7,E=CC8:$8,E=CC9:$9]
RewriteRule ^/part2-iter/.{9}(.)(.)(.)(.)(.) - [E=CC10:$1,E=CC11:$2,E=CC12:$3,E=CC13:$4,E=CC14:$5]
RewriteCond %{ENV:CC1}
RewriteCond %{ENV:CC1}
RewriteCond %{ENV:CC1}
RewriteCond %{ENV:CC1}
RewriteCond %{ENV:CC1}
RewriteCond %{ENV:CC1}
RewriteCond %{ENV:CC1}
RewriteCond %{ENV:CC1}
RewriteCond %{ENV:CC1}
RewriteCond %{ENV:CC1}
RewriteCond %{ENV:CC1}
RewriteCond %{ENV:CC1}
RewriteCond %{ENV:CC1}
RewriteCond %{ENV:CC2}
RewriteCond %{ENV:CC2}
RewriteCond %{ENV:CC2}
RewriteCond %{ENV:CC2}
RewriteCond %{ENV:CC2}
RewriteCond %{ENV:CC2}
RewriteCond %{ENV:CC2}
RewriteCond %{ENV:CC2}
RewriteCond %{ENV:CC2}
RewriteCond %{ENV:CC2}
RewriteCond %{ENV:CC2}
RewriteCond %{ENV:CC2}
RewriteCond %{ENV:CC3}
RewriteCond %{ENV:CC3}
RewriteCond %{ENV:CC3}
RewriteCond %{ENV:CC3}
RewriteCond %{ENV:CC3}
RewriteCond %{ENV:CC3}
RewriteCond %{ENV:CC3}
RewriteCond %{ENV:CC3}
RewriteCond %{ENV:CC3}
RewriteCond %{ENV:CC3}
RewriteCond %{ENV:CC3}
RewriteCond %{ENV:CC4}
RewriteCond %{ENV:CC4}
RewriteCond %{ENV:CC4}
RewriteCond %{ENV:CC4}
RewriteCond %{ENV:CC4}
RewriteCond %{ENV:CC4}
RewriteCond %{ENV:CC4}
RewriteCond %{ENV:CC4}
RewriteCond %{ENV:CC4}
RewriteCond %{ENV:CC4}
RewriteCond %{ENV:CC5}
RewriteCond %{ENV:CC5}
RewriteCond %{ENV:CC5}
RewriteCond %{ENV:CC5}
RewriteCond %{ENV:CC5}
RewriteCond %{ENV:CC5}
RewriteCond %{ENV:CC5}
RewriteCond %{ENV:CC5}
RewriteCond %{ENV:CC5}
RewriteCond %{ENV:CC6}
RewriteCond %{ENV:CC6}
RewriteCond %{ENV:CC6}
RewriteCond %{ENV:CC6}
RewriteCond %{ENV:CC6}
RewriteCond %{ENV:CC6}
RewriteCond %{ENV:CC6}
RewriteCond %{ENV:CC6}
RewriteCond %{ENV:CC7}
RewriteCond %{ENV:CC7}
RewriteCond %{ENV:CC7}
RewriteCond %{ENV:CC7}
RewriteCond %{ENV:CC7}
RewriteCond %{ENV:CC7}
RewriteCond %{ENV:CC7}
RewriteCond %{ENV:CC8}
RewriteCond %{ENV:CC8}
RewriteCond %{ENV:CC8}
RewriteCond %{ENV:CC8}
RewriteCond %{ENV:CC8}
RewriteCond %{ENV:CC8}
RewriteCond %{ENV:CC9}
RewriteCond %{ENV:CC9}
RewriteCond %{ENV:CC9}
RewriteCond %{ENV:CC9}
RewriteCond %{ENV:CC9}
RewriteCond %{ENV:CC10}
RewriteCond %{ENV:CC10}
RewriteCond %{ENV:CC10}
RewriteCond %{ENV:CC10}
RewriteCond %{ENV:CC11}
RewriteCond %{ENV:CC11}
RewriteCond %{ENV:CC11}
RewriteCond %{ENV:CC12}
RewriteCond %{ENV:CC12}
RewriteCond %{ENV:CC13}
RewriteRule ^ - [E=ALL_PART2_CHARS_DISTINCT:1]
RewriteCond %{ENV:ALL_PART2_CHARS_DISTINCT} =1
RewriteRule ^/part2-iter/(.{14})[^/]*/(1+)$ /part2-complete/$1/1111111111111$2 [R=301,L]
RewriteCond %{ENV:ALL_PART2_CHARS_DISTINCT} !=1
RewriteRule ^/part2-iter/.([^/]+)/(1+)$ /part2-iter/$1/1$2 [R=301,L]
</VirtualHost>