could someone check this regex I wrote, it does what I wanted to achieve, but I'm not sure if it's the correct way to do it and if it's not slowing everything up
That's what it should do:
IF the URL Path is longer than the domain only AND IF it doesn't contain the strings "/de" or "/en" at the beginning THEN 301 it to the domain only
That's what I wrote:
RewriteCond %{HTTP_HOST} !^(www\.)?example\.com$
RewriteCond %{HTTP_HOST} ^(?!.*(/de|/en))
RewriteRule .* http://example.com/ [L,R=301]
... is there a better way to achieve that?
Thanks!! Urs