• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 407
  • Last Modified:

Domain re direction and HTACCESS question

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
Neil_Bradley
Asked:
Neil_Bradley
  • 4
  • 3
1 Solution
 
gmaddockgreeneCommented:
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
 
comeranCommented:
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
 
gmaddockgreeneCommented:
Good job comeran :)

That actually helps me too.

Gary
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
comeranCommented:
Glad I could help  :)
0
 
gmaddockgreeneCommented:
Although, does that not cause a loop?
0
 
comeranCommented:
No, it just forwards every page to the new domain:

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

0
 
gmaddockgreeneCommented:
Did I not deserve something for the assist Neil?

And immediate intial help response?

Glad to help.
0
 
Neil_BradleyWeb UX/UI DeveloperAuthor Commented:
Cheers, thatv was brilliant. It solved the problem right away.
Many thanks.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now