You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Rose, John B" <jb...@utk.edu> on 2014/05/02 20:18:18 UTC

[users@httpd] Change from ~username to /username questions

Has anyone changed access to personal web sites from

website.com/~username

 to

website.com/username

And still use

/home/username/public_html

As the home web directories?

If so, can you share your method?

Thanks

Re: [users@httpd] Change from ~username to /username questions

Posted by Otis Dewitt - NOAA Affiliate <ot...@noaa.gov>.
Greetings Yehuda,


1.) You can try something likfe this for one url:

RewriteRule ^~blog/(.*)$ /site/legacy/users/blog/$1 [R=301,L]


2.) You can also play with this rewrite to make fit for you:

RewriteEngine On
#RewriteLog logs/rewrite.log # Uncomment for rewrite logging
#RewriteLogLevel 3 # uncomment for verbose logging
RewriteCond %{REQUEST_URI} ^/([^/]+)
RewriteCond /home/%1 -d
RewriteRule ^/([^/]+)(.*) /home/$1/public_html/$2


Thanks,
Otis


On Sun, May 4, 2014 at 10:54 PM, Yehuda Katz <ye...@ymkatz.net> wrote:

> mod_userdir does not support this. You would have to create a symlink for
> each user.
> Off the top of my head, you might be able to work around it with
> mod_rewrite, but I can't test any rules now, so I don't want to try writing
> one.
>
> - Y
>
>
> On Fri, May 2, 2014 at 2:18 PM, Rose, John B <jb...@utk.edu> wrote:
>
>>  Has anyone changed access to personal web sites from
>>
>>  website.com/~username
>>
>>   to
>>
>>  website.com/username
>>
>>  And still use
>>
>>  /home/username/public_html
>>
>>  As the home web directories?
>>
>> If so, can you share your method?
>>
>>  Thanks
>>
>
>

Re: [users@httpd] Change from ~username to /username questions

Posted by Yehuda Katz <ye...@ymkatz.net>.
mod_userdir does not support this. You would have to create a symlink for
each user.
Off the top of my head, you might be able to work around it with
mod_rewrite, but I can't test any rules now, so I don't want to try writing
one.

- Y


On Fri, May 2, 2014 at 2:18 PM, Rose, John B <jb...@utk.edu> wrote:

>  Has anyone changed access to personal web sites from
>
>  website.com/~username
>
>   to
>
>  website.com/username
>
>  And still use
>
>  /home/username/public_html
>
>  As the home web directories?
>
> If so, can you share your method?
>
>  Thanks
>