Changing Primary Domain

This is used for general discussion that is not necessarily server-related.
Post Reply
User avatar
HoLyCoW
A regular
A regular
Posts: 32
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sat Jul 21, 2012 11:38 pm

Changing Primary Domain

Post by HoLyCoW »

My clan's website currently has a domain name that we want to change.

Right now it's setup so that:

http://www.domain1.com redirects to http://domain1.com
http://www.domain2.com redirects to http://domain1.com
http://domain2.com redirects to http://domain1.com

How can we change this so that our domain2 is the main domain name?

http://domain2.com redirects to http://www.domain2.com
http://www.domain1.com redirects to http://www.domain2.com
http://domain1.com redirects to http://www.domain2.com

Thanks in advance
User avatar
Edge100x
Founder
Founder
Posts: 13129
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Changing Primary Domain

Post by Edge100x »

It depends on how you have the redirect set up and your application. Are you running this on our webhosting here?
User avatar
HoLyCoW
A regular
A regular
Posts: 32
Joined: Sat Jul 21, 2012 11:38 pm

Re: Changing Primary Domain

Post by HoLyCoW »

Yes, the webhosting is currently done by nuclear fallout.

Here's my clan's current setup:

Image
User avatar
Edge100x
Founder
Founder
Posts: 13129
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Changing Primary Domain

Post by Edge100x »

Do you have the redirect set up through an .htaccess file, or is it through your application settings?
User avatar
HoLyCoW
A regular
A regular
Posts: 32
Joined: Sat Jul 21, 2012 11:38 pm

Re: Changing Primary Domain

Post by HoLyCoW »

Well there are no .htaccess files, so it would have to be through the application.
User avatar
TimeX
Staff
Staff
Posts: 1796
Joined: Thu Jul 22, 2004 12:24 am
Location: Big Bear, CA

Re: Changing Primary Domain

Post by TimeX »

Are you certain that file doesn't exist? It is hidden by default and can only be seen with an FTP client enabled to show hidden files.
TimeX
User avatar
HoLyCoW
A regular
A regular
Posts: 32
Joined: Sat Jul 21, 2012 11:38 pm

Re: Changing Primary Domain

Post by HoLyCoW »

Yeah, I have my ftp client setup to show hidden files.
IcEWoLF
This is my homepage
This is my homepage
Posts: 1192
Joined: Thu Aug 10, 2006 9:41 pm
Contact:

Re: Changing Primary Domain

Post by IcEWoLF »

HoLyCoW wrote:Yeah, I have my ftp client setup to show hidden files.
Then create an .htacess file with the redirects.
Image
Image
User avatar
HoLyCoW
A regular
A regular
Posts: 32
Joined: Sat Jul 21, 2012 11:38 pm

Re: Changing Primary Domain

Post by HoLyCoW »

But now with no .htaccess file, it automatically goes to domain1.com

So, wouldn't that create an infinite loop if I redirect domain1.com to domain2.com?

If I create the .htacess file, would this be sufficient?

.htaccess

Code: Select all

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

RewriteCond %{HTTP_HOST} ^www.domain1.com$ [NC]
RewriteRule ^(.*)$ http://www.domain2.com/$1 [R=301,L]
</IfModule>
User avatar
Edge100x
Founder
Founder
Posts: 13129
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Changing Primary Domain

Post by Edge100x »

If going to domain2 automatically redirects to domain1 right now, then you will have to look in your application for a setting for this. In phpbb, for instance, it would be under Server Settings->Domain name in the ACP.
Post Reply