Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'mod_alias should also work' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
mod_alias should also work
Authored by: dukeku on Oct 28, '02 08:09:30PM

I'm pretty sure you could just use Alias (if mod_alias is installed.)

It would be something like this in a .htaccess file or in httpd.conf (don\'t hold me to this, I\'m doing this entirely from memory, and it probably is wrong)

Alias /Users/name/Sites /name

The actual format is in the Apache manual, under mod_alias. That would make it so that when someone requests http://1.2.3.4/name/, it would map that to /Users/name/Sites. Something like that. I would look in the Apache manual on it before trying it though.



[ Reply to This | # ]
mod_alias should also work
Authored by: Vhalkyrie on Oct 30, '02 12:31:57AM

Yes, the preferred way to do this is through apache with an alias. Go to /private/etc/httpd/users. In that directory should be the individual conf files for each user. Open the files and add the line:

Alias /name "/Users/name/Sites"

Where name is the user's name. Restart apache.

If you have a small number of users, edit by hand. If you have a large number of users, script it! These files are automatically created when you add a new user, so there's probably a way to edit it at the source so you don't have to do this every time you add a new user.



[ Reply to This | # ]
mod_alias should also work
Authored by: Schwie on Feb 14, '04 12:50:34PM
From MacWorld:

Banish the Tilde from Users' Site Names

With OS X's built-in Personal Web Sharing (found in the Sharing preference pane), every user on your Mac can have a personal Web site that others can access at a URL such as http://your.ip.number/~user_name.

If you don't like having the tilde in the URL, however, you can easily remove it with Terminal and an admin password.

Open a Terminal window, and then type

cd /etc/httpd/users

to switch to the directory that Apache (the built-in Web server) uses to manage the user sites. If you're unsure of your users' short names, type ls to see a list of the available configuration files. Say you want to modify the settings for a user named Alice:
type sudo pico alice.conf
and enter your admin password when prompted to do so. Once the file is open, type the following above the first line (the one that begins with

Alias /alice "/Users/alice/Sites".

This Alias command acts just like an alias file in the Finder -- it tells Apache that someone looking for a page at the /alice URL should be sent to Alice's Sites folder instead.

Once you've added the line, press control-X to exit, and then press Y when pico asks if you'd like to save the modified buffer -- this will write your changes to the file.

Return to the Sharing preference pane, and turn the Personal Web Sharing feature off and then back on. This restarts Apache, which will then read the modified configuration. From now on, you can skip the tilde and just type http://your.ip.address/alice to get to Alice's Web site. Repeat this process for any other user URL you'd like to modify.



[ Reply to This | # ]