i am having a small custom built web app in PHP/MySql. i want to make it white label by allowing others (my selected clients) to point their subdomain to that app.
i have :
www.MainSite.ab and www.MainSiteAddonDomain.abc.ab
i want :
subdomain.myclientsite.com --> (mywebsite)/subfolder/
and address bar should show my clients url instead of my website like
subdomain.myclient.com/subfolder/
what i did:
i added a (CNAME / A) record at myclient.com to my servers (domain / IP) and then in my main website i added a parked domain (subdomain.myclient.com) and then in manage redirected i redirected it to /subfolder/
it all worked well BUT
if i open subdomain.myclient.com/index.php then it would open www.MainSite.ab that i dont want to open since it exposes our brand and violate white labeling. (this could be possible via .htaccess i guess)
what is the right way to achieve this ? since parked domains home directory is always at main domains home directory.
one thing more, the www.mainsite.ab/subfolder/ includes some library resources that are placed at www.mainsite.ab/library/ folder.
Related
I'm working on a website that has multple websites installed (via same CMS) and used as international websites.
The server at the moment is connected with a main domain www.example.com. International installs are folders in its public_html. They are pretty independent of each other.
Now the international domains like example.co.uk are actually defined as add-on domains that redirect to public_html/uk folder (which has its own htaccess, and again its CMS installation; files and db).
My question is what would happen if I point www.example.com to another server? what would happen if someone tries to access example.co.uk?
Ideally I'd like that public_html/uk folder to be connected with the domain example.co.uk but yeah setting the DNS to a folder is not possible.
Thanks everyone.
If you point your example.com to another server, this domain obviously would display content from the new server instead.
If you've set the home/root directory for example.co.uk as public_html/uk (which you probably have done), this domain will serve that folder as expected and changing the main domain would not affect this.
I am completely confused the last few days with this and I still haven't found an outcome that's worked.
Basically I have a domain name without hosting at letshost.ie which is dublinplasterer.ie
I also Have one domain & hosting with godaddy for domain- shanafagan.com which is my own site for web/graphic design service.
I created a subdomain= dublinplasterer.shanafagan.com and uploaded the site files.
Basically I want for example when someone types in dublinplasterer.ie in the address bar if goes to dublinplasterer.shanafagan.com but doesn't show dublinplasterer.shanafagan.com url, stays as dublinplasterer.ie
Im not even sure if this can be done at this stage. head is melted
shanafagan.com and the subdomain dublinplasterer.shanafagan.com have the same ip so how will that work if changing dns?
Any help would be greatly appreciated , am so stuck at this stage.
If you wanted to do it this way you would need a web server for domain2.com
Search for ProxyPass.
The way you should do this is add a second domain on your web hosting (cpanel for example) and point the other domain to this web server.
If you are struggling I recommend using a solution like cPanel that is widely used and simplifies much of the process. It is common enough you can google most issues.
So normally you would have started by making an add-on domain (instead of a subdomain) which would also create it's own subdomain anyway. To do that, you go to your cPanel in GoDaddy and find add-on domain, then make it "dublinplasterer.ie" (Don't add www. to it. Even though this name is hosted elsewhere, we will later go to your DNS files at that hosting and point it to your GoDaddy's name servers and this add-on helps it direct to the right root folder) then choose your local root folder for that site (I think you can actually make this the same as your other subfolder already hosting your files and then it will just pull the same site) or you can pick a different subfolder and then make the add-on domain. This tells any request to this name server that if it is a request for "dublinplasterer.ie" it needs to send it to the subfolder you specified.
If you don't make the subfolder the same as the one you already made, you can either load the same content into your new subfolder or create a CNAME record telling this add-on to point to your subfolder instead but that is more complex so go with the other route.
Lastly, you need to go to your original hosting at letshost.ie and under your domain name find the DNS records tab. Change the name servers to match your GoDaddy ones and now (may take a day or two to show as DNS changes often take days and can't be seen immediately but you can try using a different device/computer/mobile that hasn't loaded it previously to see if it will refresh the correct dns) it should work. Even though it points to your main site name servers, the add-on domain you made receives it and directs it to the subfolder you specified on the add-on domain.
Hope that helps, let me know if it works for you.
Say I've got two distinct domains:
1) http://sub.test.org
2) http://m.sub.test.org
for my website.
I want domain n.1 to be associated to the full-version of my website (intended to be mainly visited by desktop user agents) and domain n.2 to be associated to its mobile-version (intended to be mainly visited by mobile user agents).
Both of the versions reside on an external host which runs an instance of Apache webserver I can't control directly, but I am able to post .htaccess files and therefore I want them to control domain redirecting stuff (I don't want to use Javascript neither PHP server-side logic)
The directory structure on the external host is, say:
directory / --> contains full-version website's pages and resources
(index.html is the entry-point)
directory /mobile --> contains full-version website's pages and resources
(index.html is the entry-point)
and the mappings are:
http://sub.test.org -> /index.html
http://m.sub.test.org -> /mobile/index.html
Now, my desired scenarios are as follows:
A) When user asks for URL http://sub.test.org:
IF current URL is http://m.sub.test.org/* (this means: if user is currently into the mobile-version) THEN serve page http://sub.test.org/index.html
ELSE:
IF user agent is mobile THEN redirect to URL http://m.sub.test.org
ELSE serve page http://sub.test.org/index.html
B) When user asks for URL http://m.sub.test.org - no matter what the user agent is - user should be redirected to URL http://sub.test.org.
My questions:
What would be the syintax of the associated .htaccess file?
Do I need more than one?
Where should I place it/them ?
Any help/code hint would be really appreciated, because I have really a few experience with Apache .htaccess files and regexps! Thanks in advance.
http://httpd.apache.org/docs/current/howto/htaccess.html
You would most likely need 2
place one it in the root and one in /mobile
I'm having trouble with the setup of the MU domain mapping plugin, I'm just getting the default server cgi page when I goto the mapped domain. These are the steps I've gone through:
Installed the plugin and moved the sunrise.php into wp-content and and added the line in the wp-config.php file.
(All my domains are hosted by LCN) Added the "*" and the IP of my hosting to the main domain.
Added the IP for my mapped domain.
Added the new site in the super admin (although I can't find any files relating to this) - http://www.teamworksdesign.com/test/
Added my IP in the domain mapping configuration.
Added the mapped domain into the dashboard so it now shows where the root files are (even though there's no folder called that in my ftp) and the site it maps to.
When I load up the mapped site it just loads the default server cgi page at www.shareandbefair.com and a LCN parking page shareandbefair.com.
Where am I going wrong? Can anyone help?
Not sure about your steps. sunrise.php should be placed in the /wp-content/ folder, not in wp-config.
You might want to walk through the step is this tutorial for the MU domain mapping plugin. The only thing that's changed between the tutorial and the current version is that you no longer move the domain_mapping.php file anywhere ... you just "network activate" the plugin instead.
If that still doesn't help, try this:
Make sure the domain to be mapped points to your existing WordPress installation. If it doesn't point at WordPress, WordPress can't map it.
Make sure the domain is registered for the site you want to map it to using the MU domain mapping plugin (looks like you've already got this).
Make sure the domain is set as the primary domain for the site you want to map it to.
If that doesn't work, try poking the WordPress support forums, dropping in #wordpress on IRC, or try Professional Domain Mapping instead ...
Turns out it was just a case of parking the mapped domain onto the main domain (where the network is).
I have an application that is currently deployed (ex. www.example.com ). However, now we have a "secure" subdomain, which will take all of the requests that need to be encrypted (ex. secure.example.com). The site that is at www.example.com is currently mapped to C:\inetpub\example.com\wwwroot\, and I've mapped secure.example.com to C:\inetpub\example.com\wwwroot\secure.
However, since secure.example.com was setup as a new website within the IIS Manager, when the secure site is visited, it displays an error since there is no web.config associated with this website; however, this is the way I want it since I want this to be a part of the application that is in the parent directory.
I think what you really meant to do was just right click on the web site for example.com and edit the bindings. In there you can add host names to that site.
Make sure you add them for port 443 which is SSL.
Map both the IIS virtual directories/web sites to the same directory, and check that are both using the same IIS application name.
(Not tried this, but can't recall seeing anything to say it would not work.)