Reputation: 149
I would like to make a multiregional website but I am having some difficulties. I use cPanel and are laying out the domains as:
I want to know how I would add the subdomains in and be able to use my one custom made php script to run these websites via .htaccess or whatever form.
Upvotes: 0
Views: 160
Reputation: 1323
You should use cPanel's parked domain feature. When you park a domain in cPanel, you can point it to the same root as your main domain. In the Parked Domains interface in cPanel, add your language subdomains (e.g. ca.example.com
). All your language subdomains will then redirect to the same main domain (example.com
).
Then, you can use PHP's $_SERVER['SERVER_NAME']
property to parse out the server name the user used to access the page, and in turn render the page in the correct language.
Upvotes: 1