We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47562
    • 113 Posts
    I'm tinkering with the directory structure and apache a bit, and seem to have things almost nailed down, but I'm running into a strange issue that I was hoping to get some insights on and help with.

    Firstly, some background. I'm working off of a local wamp install, so any problems are self-inflicted. I've moved the core to wamp/modx_core (so outside www) and renamed the manager directory (with appropriate modifications to the config). This all works fine. The problem occurs when I put an htaccess in place to generate FURLs. On the front-end, things look good, but the manager interface gets tweaked a bit.

    Without the htaccess/FURLs, everything is good, and I see:

    <div id="modx-leftbar" class=" x-plain" ...>
     <div class="x-plain-bwrap" id="ext-gen12">
      <div class="x-plain-body x-plain-body-noheader" id="ext-gen13" ...>
       <div id="modx-leftbar-tabpanel" class=" x-tab-panel modx-tabs x-tab-panel-noborder" ...>
        <div class="x-tab-panel-header x-tab-panel-header-noborder x-unselectable x-tab-panel-header-plain" id="ext-gen21" ...>
         <div class="x-tab-strip-wrap" id="ext-gen-24" ...>
          <div class="x-tab-strip x-tab-strip-top" id="ext-gen26">
           ...the tabs and info...
    


    With the htaccess/FURLs, the lefthand region with the Resources/Elements/Files tabs is no longer available, and I see:

    <div id="modx-panel-welcome-div">
     <div id="modx-panel-welcome" class=" modx-formpanel container">
      <div class="modx-formpanel-bwrap" id="ext-gen13">
       <div class="modx-formpanel-body modx-formpanel-body-noheader" id="ext-gen14">
        <div id="modx-welcome-header class=" x-panel modx-page-header x-panel-noborder" ...>
         <div class="x-panel-bwrap" id="ext-gen16">
          <div class="x-panel-body x-panel-body-noheader x-panel-body-noborder" id="ext-gen17" ...>
           <h2>undefined</h2>
    

    Anyone know why this is happening?

    Thanks!
      • 3749
      • 24,544 Posts
      Try turning off the compress_js and compress_css System Settings if you haven't already. You could try renaming the ht.access file in the Manager folder to .htaccess.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 47562
        • 113 Posts
        Quote from: BobRay at May 22, 2014, 04:40 PM
        Try turning off the compress_js and compress_css System Settings if you haven't already. You could try renaming the ht.access file in the Manager folder to .htaccess.

        Hey Bob.

        Thanks for the response. I turned off the compress of css/js. I also now turn the rewrite engine off via the htaccess in the manager folder, where previously I had the statement
        RewriteRule ^(assets|backups|mgr) - [L,QSA,NC]

        in the top-level htaccess. Anyway, no change after the modifications - tabs area still shows "undefined".

        FYI, here's the contents of the htaccess I'm using; I think most of it is straight from the docs...

        # MODX supports Friendly URLs via this .htaccess file. Pages must be
        # served via Apache with mod_rewrite to use this functionality. The base
        # directory is the root of the site. Note that FollowSymlinks may be
        # redundant (it is usually set within httpd.conf), and that the RewriteBase
        # must be set to the site root (as "/mainsite" or "/mainsite/").
        
        Options +FollowSymlinks
        RewriteEngine On
        RewriteBase /mainsite/
        RewriteCond %{HTTP_HOST} .
         
        
        # Server should have timezone setting set; if it is not, various issues will arise.
        # The following entry can compensate for this; see the details of timezone
        # definitions at http://php.net/manual/en/timezones.php.
        
        php_value date.timezone America/Los_Angeles
        
        
        # Exclude /assets, /backups and /mgr directories from rewrite rules.
        
        ##RewriteRule ^(assets|backups|mgr) - [L,QSA,NC]
         
        
        # Make URLs case-insensitive.
        
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]
        
        
        # To allow for both www.site.com and site.com to resolve to site root (for SEO),
        # uncomment one of the following options (not both). Note that the R=302 redirect
        # should be set to R=301 in the final production site.
        
        # Option (a) is rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
        ## RewriteCond %{HTTP_HOST} !^mainsite\.com [NC]
        ## RewriteRule (.*) http://mainsite.com/$1 [R=302,L]
        #
        # Option (b) is rewrite domain.com -> www.domain.com
        RewriteCond %{HTTP_HOST} !^www\.mainsite\.com [NC]
        RewriteRule (.*) http://www.mainsite.com/$1 [R=302,L]
        
        
        # The actual Friendly URLs part; if case-sensitive URLs are preferred, remove the NC.
        
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]
        
        
        # The following directives address screen flicker on CSS rollovers.
        # The Expires lines (the first four) cause image files to persist in a browser’s
        # cache for 30 days (2592000 seconds); for these, be sure that the expires_module
        # has been included in the Apache configuration. The remaining four lines actually
        # address the flicker issue in specific browsers.
        
        ExpiresActive On
        ExpiresByType image/gif A2592000
        ExpiresByType image/jpeg A2592000
        ExpiresByType image/png A2592000
        BrowserMatch "MSIE" brokenvary=1
        BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
        BrowserMatch "Opera" !brokenvary
        SetEnvIf brokenvary 1 force-no-vary 
        
        
        # Servers that support output compression may be able to realize a
        # boost in speed by uncommenting the following lines.
        
        ## php_flag zlib.output_compression On
        ## php_value zlib.output_compression_level 5
        
        
        # Fix Apache internal dummy connections from breaking the [(site_url)] cache.
        
        ## RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
        ## RewriteRule .* - [F,L]
         
        
        # Rewrite secure requests properly, to prevent SSL cert warnings (for example,
        # to prevent https://www.domain.com when a cert only allows https://secure.domain.com).
        # Note that the R=302 redirect should be set to R=301 in the final production site.
        
        ## RewriteCond %{SERVER_PORT} !^443
        ## RewriteRule (.*) https://mainsite.com/$1 [R=302,L]
        ## RewriteCond %{HTTP_HOST} !^(www)\.
        ## RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=302,L]
        
        
        # If the server is not already configured as such, the following directive
        # should be uncommented in order to set PHP's register_globals option to OFF.
        # This closes a major security hole that is abused by most XSS (cross-site
        # scripting) attacks. For more information, see http://php.net/register_globals.
        #
        # To verify that this option has been set to OFF, open the manager and choose
        # Reports -> System Info, then click the phpinfo() link. Do a Find on the page
        # for "register_globals"; the Local Value should be OFF. If the Master Value
        # is shown to be OFF, this directive is not needed.
        #
        # Note: IF REGISTER_GLOBALS DIRECTIVE CAUSES A 500 INTERNAL SERVER ERROR,
        # the server does not allow PHP directives to be set via .htaccess. In that
        # case, this change must be made within the php.ini file. For commercial
        # web hosts, contact the administrators/customer support for assistance.
        # A host/server which does not support having a local copy of the php.ini file
        # should include a php_flag entry for each PHP configuration variable having
        # a non-default value; any PHP config variable not so specified will take on
        # the value of its default setting. For more detailed information, refer to
        # the documentation on the www.php.net site regarding setting PHP directives.
        
        ## php_flag register_globals Off
        
          • 10208 ☆ A M B ☆
          • 1,780 Posts
          Try removing the slash from the end of the rewrite base.
          i.e.

          rewrite base /mainsite

          That file you're using is not the one that is packaged with MODX, as ht.access. Generally that would be the file to copy and change as needed. The trailing slash is not part of the instructions of this file nor the documentation (for Revo) http://rtfm.modx.com/revolution/2.x/administering-your-site/using-friendly-urls as I see in your file's comments. Where are you finding these FURL docs?

          I haven't installed MODX locally in a while, but I'm fairly sure that unless you're installing it in the root of your WAMP folder, or are installing in a sub-directory of the site folder you're using for this site that the rewrite base does not need to be set at all. I'm a little confused as to where the core is vs the other site files but regardless, unless you're installation lives at wamp/modxSite/mainsite you should not set the rewrite base at all.
            Frogabog- MODX Websites in Portland Oregon
            "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
            Having server issues? These guys have MODX Hosting perfected - SkyToaster
            • 47562
            • 113 Posts
            Quote from: frogabog at May 22, 2014, 09:14 PM
            Try removing the slash from the end of the rewrite base.
            i.e.

            rewrite base /mainsite

            That file you're using is not the one that is packaged with MODX, as ht.access. Generally that would be the file to copy and change as needed. The trailing slash is not part of the instructions of this file nor the documentation (for Revo) http://rtfm.modx.com/revolution/2.x/administering-your-site/using-friendly-urls as I see in your file's comments. Where are you finding these FURL docs?

            Yes, sorry, what I meant to say is that the actual rewrite instructions are pretty much as per the docs; anything else, mea culpa.

            In any event, I tried what you said and removed the trailing slash, and am still seeing the exact same problem.

            The directory structure I'm using is as follows:

            wamp/modx_core
            wamp/www/mainsite
            wamp/www/mainsite/assets
            wamp/www/mainsite/backups
            wamp/www/mainsite/connectors
            wamp/www/mainsite/mgr

            (Even if not needed, the rewrite base wouldn't hurt anything, would it?)

            Thanks much for the information and help. [ed. note: pauhana last edited this post 12 years, 4 months ago.]
              • 47562
              • 113 Posts
              Oh, and just to let you know, I thought I could have screwed something up, so I moved my htaccess file aside and copied over the one in the doc, making sure the base didn't have a trailing slash. Same issue...
                • 10208 ☆ A M B ☆
                • 1,780 Posts
                It doesn't appear that you need the rewrite base at all so just leave that blank. The rewrite base can affect your installation if it's used when not needed. Also, rename the folder modx_core back to core. I would wonder how MODX could find the core folder with the name change, although I could be wrong about that. Did you run setup according to the advanced install instructions?

                Try re-running setup, just in case. Clear the files in core/cache as well.
                  Frogabog- MODX Websites in Portland Oregon
                  "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                  Having server issues? These guys have MODX Hosting perfected - SkyToaster
                  • 47562
                  • 113 Posts
                  Quote from: frogabog at May 23, 2014, 03:03 PM
                  Also, rename the folder modx_core back to core. I would wonder how MODX could find the core folder with the name change, although I could be wrong about that. Did you run setup according to the advanced install instructions?

                  Ok, will try re-installing and report back.

                  I believe MODX finds where the core is via config.core.php, which in my case contains the following:

                  <?php
                  define('MODX_CORE_PATH', 'C:/wamp/modx_core/');
                  define('MODX_CONFIG_KEY', 'config');
                  ?>
                  


                  I didn't run the advanced install, I just did a normal install, moved the directories, and modified the configs. Didn't think it would cause grief and heartache, but obviously I need to rethink that...
                    • 3749
                    • 24,544 Posts
                    There are three config.core.php files. One each in the root, manager, and connectors directories (plus another one in the Setup directory if that's still there).

                    There are also a set of paths and URLs in the core/config/config.inc.php directory.

                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 47562
                      • 113 Posts
                      Quote from: BobRay at May 23, 2014, 11:51 PM
                      There are three config.core.php files. One each in the root, manager, and connectors directories (plus another one in the Setup directory if that's still there).

                      There are also a set of paths and URLs in the core/config/config.inc.php directory.

                      Yes, in my case, the three config.core.php files in root, manager, and connectors all contain the same info (as I gave above).

                      The paths and URLs in core/config/config.inc.php all look correct. (I'd be happy to post the file, if it would be of help).

                      Eventually, I'll try a reinstall, but what I'm really curious about is what would cause _('resource_groups') to be undefined when the htaccess is in place, where it works fine without that htaccess. (Exact same config files across the board...).