Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 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.

$ vi .htaccess

Append following config code:

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

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

share|improve this answer

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