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
Solved

Apache Redirect

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Navicat software trying to restore Mysql backup Connection lost 23 116
XAMPP 14 48
New OSQA server has a ton of fake users 4 71
Apache LDAP Authentication 20 24
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

808 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