I have several domains registered with 123-reg and I have shared hosting with them with an associated primary domain. Some of my domains are for specific clubs whose websites all start at the same index.php
in a folder beneath public_html
.
I want to point the club domains at this folder and for the user to see those domain names in the their browser's address bar and I'd want to be able to test them in the server or HTTP values accessible in PHP.
Try as I might, although I can get the club domains redirected, I can't retain them in the request that PHP receives. 123-reg support say this is a developer issue, but if it were possible for a developer to change the URL that would be a serious security issue. I feel what I want should be possible using 123-reg's cPanel. Can anyone explain how?
It appears I have added a subdomain but not redirected. It shows in cPanel as chrisandaud.cjhall.uk
with its root (correctly) at public_html/fixsec30
where chrisandaud.me.uk
is used to create the subdomain on cjhall.uk
. If I browse to chrisandaud.cjhall.uk/phptest.php
I get a can't reach error. If I browse to chrisandaud.me.uk/phptest.php
I get the correct page, but the URL in the browser says cjhall.uk/fixsec30/phptest.php
.
I'm not a professional webmaster so please forgive my ignorance. I must be overlooking something simple!
Thanks, MrWhite. I took 123-reg advice and followed https://www.123-reg.co.uk/support/hosting/how-do-i-add-a-domain-name-to-my-webhosting-package/ to point my chrisandaud.me.uk domain name but I didn't share the same root, I pointed to the /fixsec30 beneath it. The 123-reg cPanel under subdomains shows I have chrisandaud.cjhall.uk pointed at public_html/fixsec30 and not redirected.
Double-checking things in 123-reg cPanel I see this: Looking at cPanel items under DOMAINS: I seems to have chrisandaud.me.uk as both an Addon Domain and a Subdomain. Under Subdomain it is listed as chrisandaud.me.uk and it says its Document Root is at (Home)/public_html/fixsec30 and its Subdomain is chrisandaud and it is not redirected. Under Subdomain it is listed as chrisandaud.cjhall.uk and it says its Document Root is at (Home)/public_html/fixsec30 and it is not redirected. I have no aliases and no redirects.
Using File Manager I cannot see any .htaccess files
Browsing to www.chrisandaud.me.uk/phptest.php gives me the correct content but shows www.cjhall.uk/fixsec30/phptest.php in the address bar. Any ideas?
chrisandaud.me.uk
is used to create the subdomain oncjhall.uk
" - not sure what you mean by that? "If I browse to chrisandaud.cjhall.uk/phptest.php I get a can't reach error" - what do you mean exactly by "can't reach error"? That sounds like a DNS resolution error, but if you've created the subdomain in cPanel you really shouldn't be getting a DSN error?!cjhall.uk/fixsec30/phptest.php
" - and you've definitely not created the subdomain as a "redirect" in cPanel? You say you've not, but that is exactly what will happen if you have. The other possibility is an incorrectly configured (canonical) redirect in.htaccess
. Do you have any.htaccess
files? There could be more than one in subdirectories? If you have then please edit your question to include these.cjhall.uk
andchrisandaud.me.uk
related? How are these configured in your cPanel account?