Solved

Apache Redirect

Posted on 2007-03-26
1
180 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

707 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