Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have set up a ubuntu server with apche 2 installed, I already have a windows server 2003 installed with Zywall firewall installed, I successfully started Apache2 in Ubuntu server and it is running, Now I need help in URL redirection, here is what i needed. Whenever user typed in particular URL the firewall should be configured in such a way that it should point to the Ubuntu server ip from which the page will be loaded, I understand that the virtual host should be configured this, can you help which file needed to be changed in apache for url redirection in a secure way. Thankyou.

share|improve this question

marked as duplicate by Jenny D, Ward, Iain, growse, mdpc May 29 '13 at 15:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

$ vi .htaccess

Append following config code:

 RewriteEngine on
 RewriteCond %{HTTP_HOST} ^domain\.com
 RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L] 

Save and close the file. Above code will redirect users to www.domain.com url.

share|improve this answer

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