Solved

Domain re direction and HTACCESS question

Posted on 2009-04-10
8
394 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Let’s list some of the technologies that enable smooth teleworking. 
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

706 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