We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50163
    • 6 Posts
    I've been using MODX for some time and really am impressed with it. It is a great combination of simplicity and power. I'm running MODX 2.3.3-pl.

    This question has been asked before but despite working and searching for answers for the last few days I could not find any definitive answers to some things I had problems with.

    My previous MODX installs were in the web root (public_html for me) and on this install I wanted to put MODX into the subdirectory. I'm using a CPanel server with Softalacious for the installer and it works very well but the options are pretty basic so no advanced install options are available. I did a new install to the folder named modx. My website is http://mysite.com.

    The install went well but when I went to http://mysite.com in a browser I got the list of files and directories in public_html which is to be expected since that's the site and the fallback mode is to list files. I got things working by copying the modx/index.php to public_html and setting the value of MODX_CORE_PATH to /home/mysite/public_html/modx/core/ and after that http://mysite.com takes me to the MODX home page.

    I think I have several questions that I did not find answers to and I'm confused! There's a lot of info on subdomain install and putting MODX in a subdirectory but not much information on what happens to get the site working with MODX when someone uses http://mysite.com and ends up with a list of files in public_html.

    1. What is supposed to go in the web root, public_html, directory so that when I type mysite.com it actually runs the MODX site when MODX is in the subdirectory. Do I need to use .htaccess and rewrite the http://mysite.com to http://mysite.com/modx or should I create index.php file that runs the modx/index.php file or should MODX have just worked when I type mysite.com in a browser?

    2. My site_url in the system config variables is http://mysite.com/modx/ - is that correct or should it be http://mysite.com? For multiple context sites I've had to specify the base_url and site_url by editing the Context settings for the given Context. Here I only have one context.
    My base_path is /home/mysite/pbulic_html/modx - I assume that's correct.
    My base_url is /modx/

    I've noticed that if I view a page, say the home page in the Manager I get mysite.com/modx and the page displays but if I type in mysite.com in a browser the link stays as mysite.com and the page displays.

    3. I copied the MODX ht.access file to public_html/.htaccess and enabled FURLs in MODX Manager. I changed ReWriteBase to /modx. Will FURLs still work with my install in the subdirectory? Is the <base href="[[site_url]]" still required for FURLs?

    4. I've seen many posts where they said to edit all the config files (config.inc.php, etc.) in various locations but when I look at mine it appears the the code figures out the value based on the current directory and many of these posts are for early versions of MODX so I hesitate to modify the files.

    At this point it appears I need to create something in the public_html directory that sends everyone to the modx/index.php file and from there MODX will take over - is that correct?

    Thank you for any help as I try and figure this out.

    3/28/2015 An update.

    I could not get my css which is stored as a resource to work. I have the css code in a document resource, say css and reference it via the link with ref=stylesheet. I had a base href using the site_url which is according to MODX mysite.com/modx. I changed the href to "mysite.com" and now the CSS code works just fine. The site_url needs to be mysite.com but for some reason MODX makes it mysite.com/modx when it did the install so I can create a site_url setting in the context and that will override the default and make things work again.
    [ed. note: rangermodx last edited this post 9 years, 1 month ago.]