We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25154
    • 43 Posts
    After upgrading 2.0.8 on top of itself all my pages redirect to the home page. I was trying to fix an unrelated issue by the upgrade. This site is installed on godaddy and has had no issues before this. There are no errors in the server logs for both modx and godaddy. changing .htaccess back to ht.access and turning off url rewrite allows site to work, for the most part. My htaccess file is not modded. Its the same that comes with modx.

    I’ve read other posts like this and the solution was about not having [[*content]] in my template, but all my templates do contain this tag.

    Again, this is not after a site migration though i did check my modx_workspaces entry to ensure the path was correct.
      • 3749
      • 24,544 Posts
      Make sure you have this in the <head> section of all your templates:

      <base href="[[!++site_url]]" />
        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
        • 25154
        • 43 Posts
        Thanks, BobRay.

        I have <base href="[[++site_url]]" /> in my head chunk that I use for all pages. I tried yours with the exclamation mark "<base href="[[!++site_url]]" />", but that didn’t work either.
          • 3749
          • 24,544 Posts
          Check the rewrite base line in .htaccess and the rewrite rule.

          Also, take a look at the index.php file in the root and look for signs of hacking.
            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
            • 25154
            • 43 Posts
            index.php:

            <?php
            /*
            * MODx Revolution
            *
            * Copyright 2006-2010 by the MODx Team.
            * All rights reserved.
            *
            * This program is free software; you can redistribute it and/or modify it under
            * the terms of the GNU General Public License as published by the Free Software
            * Foundation; either version 2 of the License, or (at your option) any later
            * version.
            *
            * This program is distributed in the hope that it will be useful, but WITHOUT
            * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
            * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
            * details.
            *
            * You should have received a copy of the GNU General Public License along with
            * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
            * Place, Suite 330, Boston, MA 02111-1307 USA
            *
            */
            $mtime= microtime();
            $mtime= explode(" ", $mtime);
            $mtime= $mtime[1] + $mtime[0];
            $tstart= $mtime;

            error_reporting(E_ALL & ~E_NOTICE);

            /**
            * @deprecated 2.0.0
            * For backward compatibility with MODx 0.9.x
            */
            define("IN_PARSER_MODE", "true");
            /**
            * @deprecated 2.0.0
            * For backward compatibility with MODx 0.9.x
            */
            define("IN_MANAGER_MODE", false);

            /* define this as true in another entry file, then include this file to simply access the API
            * without executing the MODx request handler */
            if (!defined(’MODX_API_MODE’)) {
            define(’MODX_API_MODE’, false);
            }

            /* this can be used to disable caching in MODx absolutely */
            $modx_cache_disabled= false;

            /* include custom core config and define core path */
            @include(dirname(__FILE__) . ’/config.core.php’);
            if (!defined(’MODX_CORE_PATH’)) define(’MODX_CORE_PATH’, dirname(__FILE__) . ’/core/’);

            /* include the modX class */
            if (!@include_once (MODX_CORE_PATH . "model/modx/modx.class.php")) {
            $errorMessage = ’Site temporarily unavailable’;
            @include(MODX_CORE_PATH . ’error/unavailable.include.php’);
            header(’HTTP/1.1 503 Service Unavailable’);
            echo "<html><title>Error 503: Site temporarily unavailable</title><body><h1>Error 503</h1><p>{$errorMessage}</p></body></html>";
            exit();
            }

            /* start output buffering */
            ob_start();

            /* Create an instance of the modX class */
            if (empty($options) || !is_array($options)) $options = array();
            $modx= new modX(’’, $options);
            if (!is_object($modx) || !($modx instanceof modX)) {
            @ob_end_flush();
            $errorMessage = ’<a href="setup/">MODx not installed. Install now?</a>’;
            @include(MODX_CORE_PATH . ’error/unavailable.include.php’);
            header(’HTTP/1.1 503 Service Unavailable’);
            echo "<html><title>Error 503: Site temporarily unavailable</title><body><h1>Error 503</h1><p>{$errorMessage}</p></body></html>";
            exit();
            }

            /* Set the actual start time */
            $modx->startTime= $tstart;

            /* Set additional logging options including level and target: */
            $modx->setLogLevel(modX::LOG_LEVEL_ERROR);
            $modx->setLogTarget(’FILE’);

            /* Set debugging mode (i.e. error_reporting): */
            $modx->setDebug(E_ALL & ~E_NOTICE);

            /* Initialize the default ’web’ context */
            $modx->initialize(’web’);

            /* execute the request handler */
            if (!MODX_API_MODE) {
            $modx->handleRequest();
            }
              • 25154
              • 43 Posts
              .htaccess


              # MODx supports Friendly URLs via this .htaccess file. You must serve web
              # pages via Apache with mod_rewrite to use this functionality, and you must
              # change the file name from ht.access to .htaccess.
              #
              # Make sure RewriteBase points to the directory where you installed MODx.
              # E.g., "/modx" if your installation is in a "modx" subdirectory.
              #
              # You may choose to make your URLs non-case-sensitive by adding a NC directive
              # to your rule: RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]

              #Start Custom
              ErrorDocument 403 /403.html
              ErrorDocument 404 /404.html
              ErrorDocument 500 /500.html
              #End Custom

              RewriteEngine On
              RewriteBase /



              # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
              RewriteCond %{HTTP_HOST} .
              RewriteCond %{HTTP_HOST} !^bodycustom\.net [NC]
              RewriteRule (.*) http://bodycustom.net/$1 [R=301,L]
              #
              # or for the opposite domain.com -> www.domain.com use the following
              # DO NOT USE BOTH
              #
              #RewriteCond %{HTTP_HOST} .
              #RewriteCond %{HTTP_HOST} !^www\.example-domain-please-change\.com [NC]
              #RewriteRule (.*) http://www.example-domain-please-change.com/$1 [R=301,L]



              # Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent
              # https://www.domain.com when your cert only allows https://secure.domain.com
              #RewriteCond %{SERVER_PORT} !^443
              #RewriteRule (.*) https://bodycustom.net/$1 [R=301,L]



              # The Friendly URLs part
              RewriteCond %{REQUEST_FILENAME} !-f
              RewriteCond %{REQUEST_FILENAME} !-d
              RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]



              # Make sure .htc files are served with the proper MIME type, which is critical # for XP SP2. Un-comment if your host allows htaccess MIME type overrides.

              #AddType text/x-component .htc



              # If your 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: http://php.net/register_globals
              #
              # To verify that this option has been set to OFF, open the Manager and choose
              # Reports -> System Info and then click the phpinfo() link. Do a Find on Page
              # for "register_globals". The Local Value should be OFF. If the Master Value
              # is OFF then you do not need this directive here.
              #
              # IF REGISTER_GLOBALS DIRECTIVE CAUSES 500 INTERNAL SERVER ERRORS :
              #
              # Your server does not allow PHP directives to be set via .htaccess. In that
              # case you must make this change in your php.ini file instead. If you are
              # using a commercial web host, contact the administrators for assistance in
              # doing this. Not all servers allow local php.ini files, and they should
              # include all PHP configurations (not just this one), or you will effectively
              # reset everything to PHP defaults. Consult www.php.net for more detailed
              # information about setting PHP directives.

              #php_flag register_globals Off



              # For servers that support output compression, you should pick up a bit of
              # speed by un-commenting the following lines.

              #php_flag zlib.output_compression On
              #php_value zlib.output_compression_level 5



              # The following directives stop screen flicker in IE on CSS rollovers. If
              # needed, un-comment the following rules. When they’re in place, you may have
              # to do a force-refresh in order to see changes in your designs.

              #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
                • 6228
                • 249 Posts
                Do you have dedicated error pages (not found, not authorized, not available), or do they all default to the home page?
                  lo9on.com

                  MODx Evolution/Revolution | Remote Desktop Training | Development
                  • 25154
                  • 43 Posts
                  Defaults to home page however if I change this page to another resource and test the site I do not get the page I set the error page to which tells me there is no error going on.

                  Also tried changing the default landing page and this works as expected so rather than site starts on resource 1 I tried 18 and 18 pulled up when entering in my domain name.
                    • 25154
                    • 43 Posts
                    Sorry, I should note that I just placed those 3 error pages in my site AND 3 corresponding tags into htaccess yesterday. Those are completely new and not related to this issue.
                      • 6228
                      • 249 Posts
                      Your friendly URLs should work.

                      I would double-check that your FURL settings are correct in your system settings and clear your cache once again. If all pages still redirect to homepage, you may want to consider backing up your database and files and doing an upgrade install.

                      If you still have issues, you might want to consider a clean install (using your existing database) and manually migrate your special assets and core directories: components, packages, etc. It’s a bit of a pain, but I do all my updates this way, unless I have a high level of confidence in the server hosting the site that files won’t timeout or fail to overwrite.

                      On a related note, the [tt][[*content]][/tt]tag is meant to be included in templates. How that would adversely affect FURLs is beyond me. huh
                        lo9on.com

                        MODx Evolution/Revolution | Remote Desktop Training | Development