Solved

.htaccess (Apache) domain forwarding

Posted on 2014-04-28
3
290 Views
Last Modified: 2014-04-29
what .htaccess statement is best to use
to forward  ANY URL (wildcard)  for domain1.com (www or no www)
to domain2.com/index.html  (full URL on another server)

thanks!
0
Comment
Question by:willsherwood
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
Edwin Hoffer earned 500 total points
ID: 40027041
Hello willsherwood,

Use this code in your .htaccess file

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
  RewriteCond %{HTTP_HOST} ^www.olddomain.com$
  RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]
</IfModule>

Open in new window


Thanks

Edwin J Hoffer
0
 

Author Closing Comment

by:willsherwood
ID: 40027073
thanks for your great solution and QUICK RESPONSE!
0
 
LVL 12

Expert Comment

by:Edwin Hoffer
ID: 40028915
You're welcome
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now