LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   redirect sites (https://www.linuxquestions.org/questions/linux-server-73/redirect-sites-855455/)

linuxguy08 01-10-2011 07:19 PM

redirect sites
 
Hi,

we have our own site is running say for example www.xxx.net which is working fine but when i try to access http://xxx.net it doesnot work. I tried to make in DNS server by creating alias name but no luck.
Also created one entry in apache conf as Serveralias xxx.net under www.xxx.net still same issue.

Is there any way to redirecct whenever we access http://xxx.net which should redirec to www.xxx.net which is configured in apache.
Pls help me this out
Thanks

linuxguy08 01-10-2011 07:37 PM

server running as
Red Hat Linux release 8.0 (Psyche)

kernel version

2.4.18-14

Gmamakis 01-10-2011 08:56 PM

inside the httpd folder look for a vhosts configuration file (in Debian it is located in extra)

In there put a virtual host mapping your IP address and port from xxx.net to the folder your site is located

<VirtualHost xxx.xxx.xxx.xxx>
DocumentRoot /www/docs/xxx.net
ServerName xxx.net
</VirtualHost>

If your are using bind you could also map it through bind (as far as I recall) in your zones

mr.b-o-b 01-10-2011 09:16 PM

You do not need to use apache's vhosts.conf for this setup. Something must be wrong with your dns.

You should modify your "@" record to point to your apache IP, then create a "www" alias that point to "@". This is what I do, and xxx.net & www.xxx.net have always worked. Either way the dns will serve up the correct IP, and the browser will take you to port 80. As long as you want the xxx.net & www.xxx.net to be the same thing no special setup is required.

Check you DNS.

Good Luck!

linuxguy08 01-12-2011 01:36 PM

Is there anything like Rewrite options will work in apache conf?


All times are GMT -5. The time now is 10:33 PM.