Whats the technology behind sites like (Google Sites, Shoppify etc)? - apache

I am wondering how sites like Google sites and shopify allow customers to create a website and then link it to their own domain?. Google sites allow a user to create their own website, at a user supplied domain, and shopify allows a user to create their own e-commerce site - once again, they can supply their own domain to be used to access the webshop created.
In both cases, the website is ostensibly accesed by typing the users domain name in the browser, although the website is actually being hosted by a third party company (Google, Shopify etc)
How is this possible?. Does anyone have an insight into how this is (likely) being done?

I imagine that the technology is DNS, or more precisely CNAME records which alias one DNS name (e.g. "vole-strangling.com") to another (e.g. "vole-strangling.sites.google.com").

Subdomain RewriteRule
why dont you use mod_rewrite rules to do the trick
http://forums.digitalpoint.com/showthread.php?t=33868

Related

How to setup domain routing for a CakePHP and Apache website builder?

I have a CakePHP website that is designed to let users generate their own simple 1-4 page sites.
The idea is that people go to app.example.com (where the website is hosted), create an account, and generate their website.
After generation, their website gets an ID (I have this setup as a UUID instead of a sequential counter).
Currently, users can access their websites by going to example.com/websites/{PAGE}/{WEBSITE ID}
I want to reformat that into {WEBSITE ID}.example.com/{PAGE}.
I am running all of this on a Linux server with apache, and my plan would be to use some form of wildcard DNS record for all subdomains. Users would not be expected to use their UUID subdomains for their website, but they would instead be expected to purchase a domain and setup a CNAME record.
My initial thought would be that this would somehow be done with apache, but I am not sure.
Any help or advice would be appreciated.

How to let google know i'm the verified owner of 3 websites running with same content

I have 3 e-commerce websites having same contents on it,the domain name is same but the extensions of all domain is different.How to inform google that i'm the verified owner of all domains.
I just wanted to let google know and seek permission to use same content is different websites of mine, so that it wouldn't affect my ranking.
Is there any code by putting which on the 3 sites, google will got to know that these same sites are of one company's????
By "the Domain name is the same but the extensions are different" i guess you mean you have example.com, example.net, example.io.
if this is what you mean, these are considered to be three different domains. you should implement canonical urls including the preffered domain or redirect all traffic to what you consider the main domain. (e.g. redirect traffic from example.net and example.io to example.com)
For each domain you should use a txt recod to verify ownerhsip in the webmaster tools, most domain providers allow you to configure this record for each domain on your own. Log into your account at your domain provider's site and search for DNS Management, Name Server Management, Control Panel, or Advanced Settings.
Then again, many CMS or e-Commerce systems support "website aliases", where you can configure your system to answer to different domain names, when all your domains point to the same server and often allow you to configure a canonical domain, so that you may even not need to run 3 identical websites.
Please specify your setup, there is not much to go on here. A good example would be:
I currently run 3 Websites (example.com, example.net,
example.io)(Drupal) on 3 Servers, each has its own domain but they
have identical content. They do not use a shared database.

Google Analytics: subdomains and Apache's basic auth

I have two question to which I can't seem to find clear answers.
(1) I have GA tracking set-up for my domain.com.
(2) I also have the same tracking code set in the <head> of some other subdomains: sub1.domain.com, sub2.domain.com, etc.
(3) The subdomains are protected with Apache's basic auth which requires to provide a username and a password to access them.
Questions:
Does GA automatically tracks traffic from subdomains?
Is it possible that GA still sends calls from auth-protected
subdomains?
Thank you!
While you have to set a domain name in the configuration tracking is not limited to that domain; Google Analytics tracks traffic from every domain with the given account id, be it domains and subdomains or different domains (except that sessions are interrupted if the user switches between domains unless you have set up cross domain tracking). So that is a yes, subdomains will be tracked.
Basic Auth prevents people from accessing your site, it does not prevent your site from accessing urls on the internet. The call to Googles tracking server is, at the end of the day, simply a call to some url. So yes, Google will still send calls from auth-protected (sub-)domains.

Redirect all traffic to holding page unless logged in using .htaccess

I currently have a landing page setup on my domain.com which already receives traffic.
It will shortly be replaced with an online store. I need to upload this store to my live server in order to get it approved by the Merchant Facility Providers (MFP), and they require it to be accessible from it's final live location on domain.com in order to get approvals. I can't have users access this site until it has met approvals.
To accomplish this I wish to redirect all domain.com traffic to domain.com/holding/ except for MFP visitors.
Ideally this would be restricted by IP address, however MFP say they will need to grant a number of external parties access, and so IP address based access will not be acceptable and I should use passwords.
So my question is, how can I automatically redirect all traffic from domain.com to the holding page domain.com/holding/ unless they have logged in using a password at domain.com/login?
Users visiting the domain.com should not be asked for a password.
Will this be possible using just .htaccess/.htpasswd?
If so, can someone suggest how the logic of how it could work?
It's not possible using just an .htaccess file as all visitors would be presented with an HTTP standard authentication dialog if you enabled it on your domain.com site at the doc_root level.
Without knowing what scripting language you're using? (you've not indicated in the tags, just apache), but you could provide one index page that both acts as a landing page for users/potential-users as well as provide a login (username/password form) for MFP parties (wherever they may come from).
That way, you fulfil both needs without offending or discriminating in any way against any party.
As #nickhar has pointed out, there appears to be no way of doing this using just .htaccess.
My solution was to use a rewrite rule to redirect all requests from domain.com to domain.com/holding unless a specific cookie was set (checked for using RewriteCond %{HTTP_COOKIE}).
I set this cookie in a php script on domain.com/login, which was password protected using .htaccess/.htpasswd.
This is by no means a particularly secure solution, but is adequate for my purposes of keeping the site hidden from general traffic while the approval process is completed.

Redirecting from subdomain to query string

There is a list of options in my website home page - for example, http://example.com. When a user clicks on option1, I want to show the URL as http://option1.example.com and not http://example.com/xyz.php?opt=option1. Any help or guidance would be appreciated.
You will either need to create a subdomain for each option and then provide the required code at that subdomain. how you set that up varies by hosting provider.
Do you really need a seperate subdomain per option?
Could you use http://abc.ca/Option1/ or http://abc.ca/Options/1/ instead?
If not you will need to contact your hosting providers about creating subdomains option1.abc.ca etc and where to put your php pages.
If you are hosting your own server with apache, I think it is possible to use a * dns entry to accept all subdomains and then you can use $_SERVER variables to get the domain being requested.