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: 39
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: 116
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: 39
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 :)

User avatar
lnuyasha
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Wed Mar 08, 2017 8:08 am
Contact:

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

Postby lnuyasha » Fri Mar 24, 2017 6:15 am

Hi mudskippa,
for simplicity, you can choose the extension of Joomla,
https://extensions.joomla.org/category/ ... direction/
Or use Joomla URL Redirect feature,
https://www.joomshaper.com/blog/how-to- ... ct-feature
I'm proud of Joomla! is a open source software created and maintained by an amazing community.

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

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

Postby mudskippa » Fri Mar 24, 2017 10:26 am

Hi lnuyasha,

Thanks for your reply. Unfortunately, as it is the main domain registered with my host, I don't think I can redirect it. All my add-on domains were fine when I put them in subfolders - I just used a redirect like you suggest, and they are working beautifully. But when I tried to redirect on the main domain, it just wouldn't work. I do think this is something I'd have to sort out with my host, because my public_html is set up with them to display my main domain contents.

Thanks for taking the time to offer some solutions, though - your answer might well help someone who is trying to sort out subdirectories for add-on domains. Redirects are really useful then.

Many thanks!

User avatar
lnuyasha
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Wed Mar 08, 2017 8:08 am
Contact:

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

Postby lnuyasha » Fri Mar 24, 2017 10:45 am

mudskippa wrote:Hi lnuyasha,

Thanks for your reply. Unfortunately, as it is the main domain registered with my host, I don't think I can redirect it. All my add-on domains were fine when I put them in subfolders - I just used a redirect like you suggest, and they are working beautifully. But when I tried to redirect on the main domain, it just wouldn't work. I do think this is something I'd have to sort out with my host, because my public_html is set up with them to display my main domain contents.

Thanks for taking the time to offer some solutions, though - your answer might well help someone who is trying to sort out subdirectories for add-on domains. Redirects are really useful then.

Many thanks!

I did not do much for you. ^^
I'm proud of Joomla! is a open source software created and maintained by an amazing community.

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

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

Postby mudskippa » Sat Mar 25, 2017 11:29 am

Well it wasn't the solution for me, but you took the time to reply, and I'm grateful for that :)


Return to “Installation Joomla! 3.x”

Who is online

Users browsing this forum: No registered users and 3 guests