LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-17-2010, 06:55 AM   #1
saran_redhat
Member
 
Registered: May 2009
Location: chennai
Posts: 247

Rep: Reputation: 16
Redirect Method in Apache


Hai friends


How to redirect one website to another website in apache.
for example
when i type www.example.com in my browser then it redirect to
www.example.com/beta. so how i do in apache , please advise me.

i am using centos 5.\

Thanks.
 
Old 04-17-2010, 07:16 AM   #2
troop
Member
 
Registered: Feb 2010
Distribution: gentoo, arch, fedora, freebsd
Posts: 379

Rep: Reputation: 96
.htaccess (or httpd.conf <Directory ..></Directory>)
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteRule ^(.*)$ http://www.example.com/beta/$1 [R=301,L]
for / only:
Code:
RewriteEngine On
RewriteRule   ^/$ http://www.example.com/beta/ [P]
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

Last edited by troop; 04-17-2010 at 07:20 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirect https apache requests to folder not in apache root bax Linux - Enterprise 4 04-12-2010 02:16 PM
apache - stage Get method noir911 Linux - Server 1 01-01-2008 04:59 AM
redirect http request to https with "post method" FMH Linux - General 0 10-01-2007 03:16 AM
redirect in Apache baslemmens Linux - Networking 6 09-02-2004 01:07 PM
Apache: Method Not Allowed Gerardoj Linux - General 2 03-21-2004 05:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration