Drupal 7 - How to access subsite on dev environment - dns

I am working on a drupal site using Domain Module
https://www.drupal.org/project/domain
There was a test copy of the site in a sandbox. The subdomain on the live site have real domain names, but i can't work there. How do i access the front end (not the admin) of these sites on the sandbox copy of the site?
So far i have tried:
test.mysite.com/domain/view/4
test.mysite.com/domain/4
test.mysite.com/d
omain/content/4
but none of these work.

There is a module called Domain Alias part of the Domain package you are using. When enabled, you will see a tab "Aliases" when you edit each domain in your site, for example /admin/structure/domain/view/1/alias would be the path to the Alias settings of your first domain.
You need to add "test.mysite.com" as alias to your domain "www.mysite.com" with the option "Do not redirect". That will make this domain accessible under both domain names. You should add aliases to all domains you need to access under different names.
You can have many aliases for the same domain if you have multiple environments. Having multiple aliases in the production database usually does no harm, you don't need to keep them as local values in the test site.

Related

Domain alias - Multi-Boutique Prestashop - Plesk

I want to be able to install a Prestashop in multi-shop mode on a dedicated Plesk server, with two aliases of different domains.
The first (shop.domain1.fr) would be the host of prestahsop, but I do not see at all how to connect the second domain alias (shop.domain2.fr) to the hosting of the first.
Do you have any links or tracks i could use ?
Thank you !
You must park second domain or sub-domain in first one. It means that both of them must have same DocumentRoot. When you create a subdomain, change DocumnetRoot to shop folder.
See crate a subdomain section in this link:
https://www.pickaweb.co.uk/kb/create-addon-sub-parked-with-plesk/

Replacing main domain server impact on add-on domains and websites

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.

Creating custom domain names for api

I have a web server using cpanel and I would like to use a custom domain on one folder for an api. So if I created a folder called api in the public_html folder then the path to that folder would be www.example.co.uk/api/(some php file). How could I change it so the folder would become a custom domain of api.example.co.uk/api/(some php file).
I have looked at a few options but don't really know the best way. I have tried to add a htaccsess file to the api folder and then create a rewrite rule to rewrite the www to api.
I also then looked at creating sub domains with the path to the api folder.
I have read that creating a A record on the server could work but I'm not quite sure how to do this. I know it can be done as most apis use some custom domain like facebooks graph api. (i.e https://graph.facebook.com/youtube/)
This will depend on if you have access to make DNS records for your root domain, example.co.uk. For example right now www. is a CNAME or A record (depends on how your web server is set up), that resolves to the address of your web server. If you made an identical record but named it api. (api. IN A ip-of-webserver), then api.example.co.uk would do the same thing that www.example.co.uk does. This is kind of pointless if they go to the same web server though, the /api/ part of the route makes it clear enough that the routes are for the api. What subdomains like facebook's are doing are pointing to a completely different application, and different web servers. For example, a company may have domains like mail.company.com, portal.company.com, sso.company.com, that all resolve to the address of different web servers for the different apps they have, but in this case it sounds like you are running one web server which is fine, you can have one web server be the api as well as serve the website.

Domain name point to subdomain of a entire different domain

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.

How to display content from another domain by editing CNAME records?

I have a site that lets people have their own e-stores, for ex- mysite.com/clientname
What I want is, if somebody opens store.clientname.com or clientname.com/store, the content is pulled from mysite.com/clientname. [ So that their users feel that they are browsing on their site ]
I know this is possible because site'e like tumblr let you do that by changing a CNAME entry for your domain to their IP address.
I do have a dedicated IP address.
Also, can this be done by editing the .htaccess file at clientname.com, and if yes, which method is better/easy?
You'll want to solve the problem in a completely different way for http://store.clientname.com/ versus http://clientname.com/store.
In the first case, you can serve the web site as a virtual host. Just set up a virtual host called store.clientname.com and set its DocumentRoot to be the existing directory that contains the files for http://mysite.com/clientname. If you have other web server configuration directives that apply to http://mysite.com/clientname then you'll also want to apply those in the virtual host. Finally, the client can set up a CNAME record in DNS for store.clientname.com pointing to your web server.
If you are using Apache, you can also use a default virtual host and mod_rewrite to dynamically translate URLs of the form http://store.{whatever}/ to http://mysite.com/{whatever}/. However, this won't work if you are using HTTPS.
In the second case, you don't want to serve the web site at http://clientname.com/ because the client presumably is already hosting that and presumably http://clientname.com/otherstuff has to continue working and come from their server. So the second case is easier for you because all the work has to be done on the client's web server. But it's simple: they will just have to configure their web server to proxy http://clientname.com/store to http://mysite.com/clientname.

Resources