1

I'm running an Ubuntu 10.04 LTS, Apache version 2.2.14.

On httpd.conf I've a rewrite rule that look like this:

RewriteRule (*UTF8)^/users/([^/])([^/]+)/(.*)$ /users/$1/$2/$1$2/$3 [L]    

The idea is to set directories to internationalized domain name (IDN) in my server.

I keep getting

RewriteRule: cannot compile regular expression

Any idea if it is the demon version or something else?

Bart De Vos
  • 18,171
koby
  • 111

1 Answers1

1

(*UTF8) is not a valid regular expression, and I'm not sure why you're requesting it--things like .* and the like in your regular expression will match any character, UTF8 encoded or not. What you're referring to is perl--not mod_rewrite, which requires explicit enabling of utf8 support.

For mod_rewrite, you're trying to treat a particular encoding in a special way, and its just not needed in this case.

I.e.,

RewriteRule ^/users/(.*)$ /newusers/$1 [L]

will match:

/users/café

and so on. However, keep in mind that using character classes like [a-zA-Z] will NOT match utf8.

Andrew M.
  • 11,412