This seems simple, but I wasn't able to do it.
I have a user that changed his username from givenname
to name
, and now I need to rewrite, changing the URL on the clients, to avoid 404 errors on ~givenname.
I thought I could do something like this:
RewriteEngine on
RewriteBase /~givenname/
RewriteRule ^~givenname/([^/]+)$ ~name/$1 [R=301,L]
But I was unable to do this.
I'm aware that mod_userdir
looks for specific user info on Unix files (/etc/passwd
) or whatever is specified on /etc/nsswitch.conf
, but there's a way to trick it and redirect to the new username?
Thanks.
PS: I'm running a little old Apache 2.2.16 server.