Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to redirect ipaddress/~username/filename to using Apache Rewrite. Can anyone point out how to do this and specifically to be able to do it for only one user at a time? Thank you in advance.

share|improve this question

If you make sure that mod_userdir and mod_rewrite are enabled, as well as then you can achieve that by creating or editing ~username/public_html/.htaccess with the following content:

RewriteEngine On
RewriteRule ^(.*)$$1 [R=301,L]

I believe that you can also achieve the same result without .htaccess, by pasting this configuration snippet inside a <Directory /home/username/public_html> ... </Directory> block, but adding the RewriteBase /~username/ directive as well.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.