mod_userdir seems to be able customize where the home folders are, but is there a way to make those available under a custom URL?
I want to provide users with a url like the following: http://example.com/arbitrarystring/[user]
mod_userdir seems to be able customize where the home folders are, but is there a way to make those available under a custom URL?
I want to provide users with a url like the following: http://example.com/arbitrarystring/[user]
This is entirely doable. I did just that and recorded the efforts here. This is a solution that does use mod-rewrite, but not deep wizardry. The problem we had was that when we were implementing user_dirs, The Powers That Be thought using a shift key to get at a directory was too much work and wanted a tilde-free version. That's a one character version of what you're doing.
The meat is in the RewriteRule statements.
RewriteRule ^/somestring/([a-z0-9]+) /~$1 [R] The problem here is that /~username will still work. You can possibly get around that by using an internal proxy-redirect to another hidden domain name.
RewriteRule ^/somestring/(a-z0-9]+) http://othervhost.example.com/~$1 [PT] mod_userdir, and your solution is well documented, I'm awarding you the bounty. Thanks for sharing!
mod_rewrite.mod_rewrite?mod_rewriteis such a complex module, I assume (perhaps mistakenly) that it'll be so much easier to come up with an insecure configuration. Also, I imagine there's some performance hit, though that's not particularly relevant in my usecase.mod_userdirjust seems tailor-made for this purpose, and I keep wondering why it's still there (in apache) ifmod_rewriteis capable of emulating it (which I know it does). I'll readily accept a mod_rewrite answer here, if there's really no other choice