Solved

Domain re direction and HTACCESS question

Posted on 2009-04-10
8
396 Views
Last Modified: 2013-11-30
I have two domains hosted in one hosting account.
domA.com is the primary domain and Domb.com is parked in that hosting account.
I run email from domB.com and that it.

At the moment I have domB configured so that when www.domB.com is typed into an address bar the website from www.domA.com shows up, but with www.domB as its URL.
What I need to do is reconfigure domB so that not only does the website of domA.com show up but domA is displayed in the URL.

I spoke with the hosts and they were not that much help and gave me some very basic info in dropping in a HTACCESS file however I am a little lost. Can anyone assist?
0
Comment
Question by:Neil_Bradley
  • 4
  • 3
8 Comments
 
LVL 6

Expert Comment

by:gmaddockgreene
ID: 24119163
Hi,

If I understand you correctly you are therefore wanting to re-direct domB to domA

This is a 301 redirect.

your .htaccess file needs to read:

(index.php is replaced with the index page ref)


RewriteEngine On

Redirect 301 /index.php http://www.domA.com

Open in new window

0
 
LVL 5

Accepted Solution

by:
comeran earned 125 total points
ID: 24119492
You need to use a 301, but the above rule will not forward everything. Cut and paste the following code into a file, rename it .htaccess remember to put the . in front of it. Change newdomain.com to the domain you want the site to point TO and then upload the .htaccess file to the site that will forward.

Thats it  :)   Then anything that goes to domB.com will forward over not just index.php.

Com-
Options +FollowSymLinks

RewriteEngine on

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

Open in new window

0
 
LVL 6

Expert Comment

by:gmaddockgreene
ID: 24119507
Good job comeran :)

That actually helps me too.

Gary
0
 
LVL 5

Expert Comment

by:comeran
ID: 24119538
Glad I could help  :)
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 6

Expert Comment

by:gmaddockgreene
ID: 24119550
Although, does that not cause a loop?
0
 
LVL 5

Expert Comment

by:comeran
ID: 24119594
No, it just forwards every page to the new domain:

domB.com/whatever.html will forward to domA.com/whatever.html

0
 
LVL 6

Expert Comment

by:gmaddockgreene
ID: 24121179
Did I not deserve something for the assist Neil?

And immediate intial help response?

Glad to help.
0
 
LVL 5

Author Comment

by:Neil_Bradley
ID: 24123295
Cheers, thatv was brilliant. It solved the problem right away.
Many thanks.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

911 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

25 Experts available now in Live!

Get 1:1 Help Now