1

I want to redirect the URL:

http://example.com/site to http://example.com/~username/site

I have the following in my httpd.conf file:

RewriteEngine on
RewriteRule ^/site/(.*) /~username/site/$1 [PT]

but this does not seem to be working. It tries to look for /site under /var/www/site/ and fails. What am I doing wrong? FYI, I have also tried with:

RewriteRule ^/site/(.*)$ /~username/site/$1 [PT]
1
RewriteEngine on
RewriteRule ^/site/(.*) /~username/site/$1 [PT]

That code should be going into .htaccess, not httpd.conf. Try that, and it should fix your issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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