Solved

Apache Redirect

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

773 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