-
☆ A M B ☆
- 318 Posts
I have subdomains working under cpanel, using cpanel to configure the subdomain to point to a subfolder. I’m using the same setup as the article you mentioned -- separate index.php in the subdomain folder which initiates the subdomain context. The main things I would double-check are that all of your context settings have been modified correctly, and that .htaccess in the subdomain folder is correct. It sounds like the mod_rewrite configuration is correct, otherwise you wouldn’t be able to see the site start. I bet there’s an internal MODx setting that needs to be changed.
As for the template problem, I think you’re probably going to want to have a separate template for the subdomain. You could copy your assets directory to the subfolder but then you have to maintain it in two places -- probably better to just make a new template and use absolute URLs to reference resources from the main domain.
Thanks for the input, Eli. When you visit yoursubdomain.yourdomain.com, does your browser display the URL as yourdomain.com/yoursubdomain? That’s what mine is doing, presumably because of the way HG handles the rewrite, and I’m suspicious that might have something to do with the problem.
I double-checked my context settings as you suggested. Other than the settings specified in the tutorial, which mine parallel exactly, the only other one I’ve overridden is the error page (with no apparent effect, as I mentioned earlier). The site is in development, so I suppose it’s possible there’s a site-wide setting that needs to be overridden and isn’t, but I don’t know what it would be.
Regarding the templates, I believe your answer is correct. Since I didn’t really need the subdomain, though, I finally decided to go with the simpler solution of creating a resource group. My original purpose in this whole project was to restrict access so some admin pages I’m creating, which can be accomplished without the use of a separate context. Nonetheless, I am curious enough to want to find out why I couldn’t get it to work. It’s always possible I’ll need to revisit the issue at a later date, or have some as-yet-unforeseen use for this kind of structure.
Well, it’s always nice to clarify the problem, even if the solution still eludes me. I contacted the web host as you suggested, and they insisted that cPanel couldn’t be the problem. We tried disabling .htaccess, and that didn’t help either. I don’t know if there’s some way MODx could be causing this behavior or not, but I can’t spend too much time right now trying to figure it out, since it’s no longer important to my current project. Anyway, thanks for all your help. I may come back to this issue some time in the future.