Multiple Rewrite rules for a group of RewriteCond
Hi,
I'm working on a site that has both EN and ES versions of pages. The rewrite rules are configured at the dispatcher and I need 2 rewrite rules to be executed for a group of RewriteConds.
Below is a sample htaccess file which works fine
RewriteCond %{REQUEST_URI} !^/cond1
RewriteCond %{REQUEST_URI} !^/cond2
RewriteCond %{REQUEST_URI} !^/cond3
RewriteRule ^/(.*)$ /content/appName/us/en/home/$1.html [PT,L]
I would like to have the ES version of the rule added to this same condition.
RewriteCond %{REQUEST_URI} !^/cond1
RewriteCond %{REQUEST_URI} !^/cond2
RewriteCond %{REQUEST_URI} !^/cond3
RewriteRule ^/es/(.*)$ /content/appName/us/es/home/$1.html [PT,L]
RewriteRule ^/(.*)$ /content/appName/us/en/home/$1.html [PT,L]
Looks like we cannot have RewriteCond have multiple rules unless we want to negate and use Skip Rules as below but this doesn't work for me
RewriteCond %{REQUEST_URI} !^/cond1
RewriteCond %{REQUEST_URI} !^/cond2
RewriteCond %{REQUEST_URI} !^/cond3
RewriteRule .? - [S=2]
RewriteRule ^/es/(.*)$ /content/appName/us/es/home/$1.html [PT,L]
RewriteRule ^/(.*)$ /content/appName/us/en/home/$1.html [PT,L]
Repeating the condition twice as below seems to work fine but I'm looking for the best solution without having to repeat the same thing.
RewriteCond %{REQUEST_URI} !^/cond1
RewriteCond %{REQUEST_URI} !^/cond2
RewriteCond %{REQUEST_URI} !^/cond3
RewriteRule ^/(.*)$ /content/appName/us/en/home/$1.html [PT,L]
RewriteCond %{REQUEST_URI} !^/cond1
RewriteCond %{REQUEST_URI} !^/cond2
RewriteCond %{REQUEST_URI} !^/cond3
RewriteRule ^/es/(.*)$ /content/appName/us/es/home/$1.html [PT,L]
Can somebody assist on what would be the best way to handle this? Thanks in advance.