Installing main domain in a subdirectory - can't redirect

Need help installing Joomla! 3.x? For all Joomla! 3.x installation issues please use this forum. Note: Users creating new sites can use either version 2.5 or 3.x. Please consider the availability of third-party templates and extensions when deciding which Joomla version to use.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
mudskippa
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Sun Jan 08, 2012 1:04 pm

Installing main domain in a subdirectory - can't redirect

Postby mudskippa » Mon Mar 20, 2017 10:38 am

Hi,

I have 3 websites on the same server. I decided to clear up the File Manager in Cpanel, so that add-on domains were in subdirectories. All well and good - I have used Cpanel Add-on to point to the root file paths of the add-on domains and they now show up perfectly.

But I am having problems with my main domain (Smyls.co.uk). When I load my main domain online, it shows an index of all my domains. I have tried making it an add-on domain and redirecting it, but I get the message: (XID bcswvw) A DNS entry for the domain “smyls.smyls.co.uk” already exists.

I'm a bit leery of fiddling with the DNS records in zone editor, so I'm asking for advice on what to do. Is there a fix I can do on the DNS records or can I edit one of the Php, index or access files for this domain to get it to show up properly?

Please be aware, I haven't had much experience with all this recently, so please talk to me as if I were a complete noob. Oh and the main domain has a new install of Joomla 3.5.6 (I have all my old files and database, but haven't even configured those yet.)

Many thanks for any help.

User avatar
cybersalt
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 110
Joined: Thu Aug 25, 2005 10:36 pm
Location: Victoria, Canada
Contact:

Re: Installing main domain in a subdirectory - can't redirect

Postby cybersalt » Mon Mar 20, 2017 4:59 pm

My experience with this is with offering webhosting on the product WHM/Cpanel.

When a new webhosting account is created, it requires a primary domain which is then pointed to the "public_html" folder.

The primary domain can be pointed to a different folder, but it cannot be done by editing a zone. Your host company needs to do this.

I have made such changes my clients in the past, so here are the instructions to pass to your host (they probably already know how to do it) if they are using WHM/Cpanel.

A quick note first, you probably should put an empty index.html file in your public_html folder to prevent people from seeing your folder structure and to secure that folder from meddling (see discussion at https://security.stackexchange.com/questions/37126/how-secure-is-using-a-blank-index-html-index-php)


You must edit the file:
/var/cpanel/userdata/USERNAME/DOMAIN.COM

and change the line:

documentroot: /home/USERNAME/public_html

to

documentroot: /home/USERNAME/public_html/DOMAIN.COM

and then run:

/scripts/rebuildhttpdconf
service httpd restart

(quoted from https://forums.cpanel.net/threads/change-the-way-primary-domain-document-root-works.383551/)
Tim Davis
Basic Joomla Tutorials | Cybersalt Consulting and Communications
https://www.cybersalt.com

mudskippa
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Sun Jan 08, 2012 1:04 pm

Re: Installing main domain in a subdirectory - can't redirect

Postby mudskippa » Mon Mar 20, 2017 5:32 pm

Many thanks Tim :)


Return to “Installation Joomla! 3.x”

Who is online

Users browsing this forum: No registered users and 4 guests