Forum Moderators: phranque
Becoz of the multiple rules that I have the second one t - t2 doesnt work.
I've tried without the C & put L as also it wont work the second rule?
Cant find real good examples with the C flag though.
Thanks - help appreciated.
Rule two will only be applied after Rule number one matches and is applied. Since the URL cannot be both 'p.html' and 't.html' at the same time, I doubt that the Chain function is what you want.
How about:
RewriteCond %{HTTP_USER_AGENT} ^Opera [NC]
RewriteRule ^(p¦t)\.html$ /$1\2.html [L]
RewriteCond %{HTTP_USER_AGENT} ^Opera [NC]
RewriteCond %{REQUEST_URI} ^/p\.html$ [OR]
RewriteCond %{REQUEST_URI} ^/t\.html$ [OR]
RewriteCond %{REQUEST_URI} ^/q\.html$ [OR]
RewriteCond %{REQUEST_URI} ^/r\.html$ [OR]
RewriteCond %{REQUEST_URI} ^/s\.html$
RewriteRule ^(.*)\.html$ /$1\2.html [L]
Note that the backslash preceding the '2' in the rewriterule is probably not needed - I just put it in there to demarcate the $1 back-reference. Also, remember to replace the "¦" character with the solid vertical pipe character from your keyboard.
Jim
<edit> Corrected typos as pointed out in following posts </edit>
[edited by: jdMorgan at 6:08 pm (utc) on Nov. 26, 2003]