redirecting site to another account on same server

esmart

New member
Joined
Jul 14, 2010
Messages
7
Hello,

I hope someone can help. I have a dynamic bespoke CMS of my own creation that is multisite enabled allowing multiple domain names to be pointed at the same location and different websites are served.

I have 1 user account setup called egeniuscms which contains the web application and I simply use "domain pointers" to point externally hosted domains at the directadmin account. This all works fine, however I now wish to host email accounts/DNS etc for a domain name.

I have create a new account and pointed the domain name to that account. This works fine as you would expect, but I need the A Name or site URL to be pointed to the other directadmin account which is the CMS system.

As the domain name has its own account, Directadmin does not allow me to add a domain pointer that points the domain name at another account on the same server..

Any help with this? perhaps deleting the accounts A Name DNS settings, then perhaps a domain pointer will work to redirect web traffic at the other account ?

Thanks in advance :)
 
We do something similar with our domain registration business. Here's how we do it:

We create the domain name on our server to handle email, etc. We completely ignore the site setup.

Here's an example using the domain name example.com:

We remove the A record for www.example.com and create a CNAME record for www.example.com pointing it to the domain where we're hosting the domain registration site.

Then we create a permanent redirect in DirectAdmin to point / to http://www.example.com.

That should work for you as well.

Jeff
 
Hi Jeff,

Thanks for your helpful post.

May I ask why you use the permanent link ie :
"Then we create a permanent redirect in DirectAdmin to point / to http://www.example.com."

Ideally I do not want the domain URLs to change at all.

So for example the main directadmin site is called www.main.com
And a new directadmin account is setup for www.client.com
Then in the DNS for client.com, I delete the A records and setup a CNAME pointing to main.com.

Do I need to alter/add anything to the main.com DNS?
If I add a redirect in main.com for / to www.main.com will www.client.com change in the browser URL to main.com ?

Need both domains pointing to main.com and retaining their URLs in browser.

Does the above make sense?

Thanks for all your help
 
In our case we want both www.1275domains.com and 1275domains.com to point to the system managing the LogicBoxes (logicboxes.com) interface, but we can't use a CNAME for 1275domains.com, and we do want 1275domains.com to handle email, etc., on our server. We use a permanent redirect so Google will understand them both as the same site.

If you don't want Google to understand them both as the same site then you can do it by setting up an Alias in your DirectAdmin control panel.

Jeff
 
Hello,

Are yes the Alias - unfortunately this is where I started this thread.

If you an an Alias to the main.com (example name) directadmin account, then you get the message:

"You cannot use that domain as a pointer. It already exists on the server"

I wish this domain to exist on the server as an account that can be used for emails etc, however needs to target another directadmin account - the CMS.

Any other thoughts?

Should I delete the directadmin account I have created for this domains email, then simply add the domain as an alias on the main account ? If I do this, can I still setup email accounts for this alias?

Thanks
 
Still no solution - Creating an Alias - does not allow setup of email accounts

I have deleted the new directadmin account and simply added the domain as an alias (domain pointer alias in directadmin), in the main da domain account.

As predicted, the web url works as it should, however I find no way of creating email accounts for this "alias" ?

Can you think of a solution that performs as the Alias, and points the domain at the already existing da account like it does now, but allows email accounts to be created for it?

Thanks
 
Hello,

Here is a detailed example of what I need to do using example domain names:

Create DA account for client.com, with ability to setup email accounts.
Point the domain to another DA account on same server called main.com

Currently if I setup client.com as an alias (domain pointer in DA) in main.com, then the URL redirects correctly, but I have no way to setup emails for client.com.

If I setup client.com as a DA account, I have no way to point it at the URL main.com


Is there no way to do this except have two servers with different IP's ?

Can anyone help ?
 
You can create an alias manually, outside of DirectAdmin, directly in the per-user httpd.conf file, but I'm not sure of the details. If you do, be sure to chattr it as immutable so DirectAdmin won't change it.

Have you tried using a separate IP# for the second domain, creating email for it there, ignoring the website there, and setting the A record for www to the main site's IP#?

You should NOT change the A record for the second domain without the www, but for that you can create a permanent redirect to www as discussed elsewhere in these forums.

Jeff
 
Hello,

Thanks for your help on this.

I have now solved it by adding an extra "shared" IP, and creating the client sites using this, but changing their DNS to point the domain.com. and the www to the main IP.

Then adding "ServerAlias *.domain.com domain.com" into the httpd configurations for the target site. (will not allow pointers/aliases created in DA for domains already on that server no matter the IP)

The effect is that the client sites have all the DA features enabled such as email accounts etc, but the sites point to the main account (CMS) where the web content is served.

Thanks for your help - hopefully this will be helpful to others too!
 
I am setting up a Wordpress MultiSite and have the exact problem.

What I understand of this thread and some of the other threads on this forum regarding this is issue, is that I need 2 IP's or it wont work?

I think this issue is quite relevant regarding the "new" Multisite feature of Wordpress and other CMS's attempt at this.

Its a topic thats really hard to google.

It could be really nice if DA could add "Fully Wordpress compatible"
When I try and google this topic, I get the impression cPanel can handle this without any work arounds.

Maybe its just me not understanding it right :)
 
I think I have a pretty simple solution after all.

main.com is a multisite setup - with the DA user called main.
client.com is one of the sites in the multisite setup - with the DA user called client.

Both client and main is created as normal DA users, with working email etc.
client.com doesn't work, it is not pointed to the multisite setup.
I can do this by deleting the client user and make a ServerAlias in the main users httpd.conf file. But then email isn't working for client.com.

So know I have the client and main user. Emails working, but the client.com doesn't point to the multisite setup.

All I did to get this to work was to add this to the client users httpd.conf via the "Custom HTTPD Configurations" and selecting client.com:

Code:
|?DOCROOT=/home/main/domains/main.com/public_html/|
|?OPEN_BASEDIR_PATH=/home/main/:/tmp:/var/tmp:/usr/local/lib/php/|

As far I can test, this works.
Is it a good solution or is it going to **** up DA, or worse is it a sercurity issue?
 
It shouldn't cause any problem that any other single-user / multi-site install of WordPress would cause.

I can see it as an advantage if an only if it's your server, or your reseller account, and if you're selling a lot of WordPress installations where you're responsible for updates. Otherwise I can see at least some issues... such as it's impossible for the user to have any pages not created by WordPress.

Jeff
 
It shouldn't cause any problem that any other single-user / multi-site install of WordPress would cause.

I can see it as an advantage if an only if it's your server, or your reseller account, and if you're selling a lot of WordPress installations where you're responsible for updates. Otherwise I can see at least some issues... such as it's impossible for the user to have any pages not created by WordPress.

Jeff

Thanks Jeff, you just described my situation and the customers only need the WordPress site I give them.
I'll let you know if there are any backsides.
 
Sorry for updating this topic
Could you please tell me how can I find all redirect urls via ssh ?
or where the redirect urls save for each users ?
 
Hi I'm also struggeling with this issue.

Just to clarify my situation:

wordpress Multi-site is hosted by wpms.mydomain.com
This is a regular "user" package called wpmsinst

Then we have the first user with mywpsite.com
It's been setup as a regular "user" package called mywpsite

Than I've added the above to the "Custom HTTPD Configurations" for "user" mywpsite:
|?DOCROOT=/home/wpmsinst/domains/wpms.mydomain.com/public_html/|
|?OPEN_BASEDIR_PATH=/home/wpmsinst/:/tmp:/var/tmp:/usr/local/lib/php/|

When going to mywpsite.com gives this error message:
Forbidden

You don't have permission to access / on this server.
Server unable to read htaccess file, denying access to be safe

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

What also needs to be addressed is how to get all of this working with SSL

Anyone have some more insights on where I go wrong with this?
 
By default users are not allowed to access other users homedirs, so you can't change document root and hope your sites will start working. You need to solve an issue with permissions. There some other threads on the forums which describe all the details.
 
Back
Top