Solved

Apache Redirect

Posted on 2007-03-26
1
179 Views
Last Modified: 2010-03-04
I want to redirect anything from http://www.oldsite.com/ANYTHING to home page for new site of http://www.newsite.com/

What are the Rewrite commands?

Where do I put it in the httpd.conf file. Do I still need the virtual host set up for oldsite.com?
0
Comment
Question by:BrentNJ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 21

Accepted Solution

by:
Julian Matz earned 125 total points
ID: 18797005
Hi!

Here is the syntax (mod_rewrite):

RewriteRule ^/(.*)$ http://www.newsite.com/$1 [R=301,L]

You can place this inside the appropriate <directory> directives. I'm pretty sure it also works inside the <VirtualHost> directive ...

For example:

<Directory "/var/www/html">
 RewriteEngine On
 RewriteRule ^/(.*)$ http://www.newsite.com/$1 [R=301,L]
</Directory>

Yes, you would still need to keep the vhost ...
0

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Server specifications for web hosting 7 96
Problem to go to page 12 111
Clearing cache in word press. 3 69
PHP: Insert Data into MySQL 5 62
As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question