We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9885
    • 6 Posts
    Hi,

    I am using Modx 1.0.4 Evo and trying to get a development site running on a subdomain (Apache Server with mod_rewrite ON)
    Everything works fine, but as soon as I activate friendly urls, I get 500 Int. Server Error.

    The subdomain lies in a sub directory of the root directory (/root/subdomain)

    The modx installation is in that subdomain directory:

    /subdomain/assets/
    /subdomain/manager/
    /subdomain/index.php
    etc.

    The maindomain url: www.mydomain.com
    The subdomain url is: modx.mydomain.com

    There are no restrictions in the .htaccess in my root directory.

    My standard .htaccess (/subdomain/.htaccess)

    #php_flag register_globals Off
    #AddDefaultCharset utf-8
    #php_value date.timezone Europe/Moscow
    
    Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    
    # Fix Apache internal dummy connections from breaking [(site_url)] cache
    RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
    RewriteRule .* - [F,L]
    
    # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
    #RewriteCond %{HTTP_HOST} .
    #RewriteCond %{HTTP_HOST} !^modx\.mydomain\.com [NC]
    #RewriteRule (.*) http://modx.mydomain.com/$1 [R=301,L]
    
    # Exclude /assets and /manager directories and images from rewrite rules
    RewriteRule ^(manager|assets)/*$ - [L]
    RewriteRule \.(jpg|jpeg|png|gif|ico)$ - [L]
    
    # For Friendly URLs
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    
    # Reduce server overhead by enabling output compression if supported.
    php_flag zlib.output_compression On
    php_value zlib.output_compression_level 5
    


    I searched the forums and there several threads about similar problems but none of them have a real solution for me.
    What do I have to change in my .htaccess to enable FURLs?

    Thanks for any help in advance.
      • 27347
      • 65 Posts
      I ain’t no expert but have you tried changing the RewriteBase setting in your .htaccess to /subdomain
        • 9885
        • 6 Posts
        Sorry, I forgot to list the things I already tried so far:

        1)
        RewriteBase /subdomain

        2)
        #RewriteRule ^(.*)$ /subdomain/index.php?q=$1 [L,QSA]

        3)
        RewriteCond %{HTTP_HOST} .
        RewriteCond %{HTTP_HOST} !^modx\.mydomain\.com [NC]
        RewriteRule (.*) http://modx.mydomain.com/$1 [R=301,L]

        All recommendations from this thread.

        I am still stuck with 500 Int. Server Error.
          • 8609
          • 607 Posts
          Did you try clearing your MODx site cache? Under the Site tab in the manager. Sounds like you’re doing everything else right although I’m not a htacess expert either smiley
            • 27347
            • 65 Posts
            also. did your check your apache (error)log? What does it say?
              • 9885
              • 6 Posts
              Yes, clearing cache has become pretty much second nature ever since I started working with Modx wink

              with htaccess:

              Options +FollowSymlinks
              RewriteEngine On
              RewriteBase /
              
              RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
              RewriteRule .* - [F,L]
              
              RewriteRule ^(manager|assets)/*$ - [L]
              RewriteRule \.(jpg|jpeg|png|gif|ico)$ - [L]
              
              RewriteCond %{REQUEST_FILENAME} !-f
              RewriteCond %{REQUEST_FILENAME} !-d
              RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
              
              php_flag zlib.output_compression On
              php_value zlib.output_compression_level 5
              


              I get:
              Options not allowed here, referer: _http://modx.mydomain.com/manager/index.php?a=1&f=menu (when accessing my manager panel)


              As soon as I upload my .htaccess, I can’t use anything in my manager panel and any sites because of 500 ISE.

              I tried deactivating each line of my .htaccess to find out what causes the error but no luck so far. With only the first 3 lines in my .htaccess active, I can’t even access my manager panel.

              Where can I take a look at the FURL script of modx? Right now I don’t have a clue how the FURLs in modx work and everything is just a guessing game.
                • 27347
                • 65 Posts
                The problem could be that Apache (httpd.conf) disallows you to make Option settings in your .htaccess
                FollowSymLinks is probably already enabled in httpd.conf

                Start with the default Evo .htaccess and only remove the line Options +FollowSymlinks

                If that doesn’t work keep the above modification in place and try amending the rewritebase from / to /subdomain




                  • 9885
                  • 6 Posts
                  My host allows the use of .htaccess with options but it seems like only for the /root directory.

                  Any not empty .htaccess in my /subdomain directory will get my a 500.

                  I guess either, there is a way to write a .htaccess that controls my maindomain and the modx FURLs in my subdomain simultanously, it’s not possible to get FURLs to work on my host server setup, which is frustrating.

                  Testing modx on localhost only is insufficient.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    It is likely that some declarations cannot be re-declared. Usually I have this problem if the root-level .htaccess has RewriteEngine On, and repeat this line in the inner .htaccess files. Those inner copies need to comment that line out.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 9885
                      • 6 Posts
                      The server setup of my host is pretty robust, so all my /root .htaccess contains are some standard IndexIgnore line for several working directories, because I disabled directory listing on purpose.

                      So my next step was using variations of the first 3 lines of the standard evo htaccess on my root htaccess. dis- and enabling them.
                      I dont’t seem to need +FollowSymlinks and RewriteEngine On.

                      RewriteBase / will get me the subdomain startpage but any links from there will get me a 404.

                      RewriteBase /subdomain will get me a 500 rightaway on my maindomain and subdomain startpage.

                      Options +FollowSymlinks
                      RewriteEngine On
                      RewriteBase /subdomain
                      


                      and the rest in my /subdomain .htaccess

                      # Fix Apache internal dummy connections from breaking [(site_url)] cache
                      RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
                      RewriteRule .* - [F,L]
                      
                      # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
                      #RewriteCond %{HTTP_HOST} .
                      #RewriteCond %{HTTP_HOST} !^subdomain\.mydomain\.com [NC]
                      #RewriteRule (.*) http://subdomain.mydomain.com/$1 [R=301,L]
                      
                      # Exclude /assets and /manager directories and images from rewrite rules
                      RewriteRule ^(manager|assets)/*$ - [L]
                      RewriteRule \.(jpg|jpeg|png|gif|ico)$ - [L]
                      
                      # For Friendly URLs
                      RewriteCond %{REQUEST_FILENAME} !-f
                      RewriteCond %{REQUEST_FILENAME} !-d
                      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
                      
                      # Reduce server overhead by enabling output compression if supported.
                      php_flag zlib.output_compression On
                      php_value zlib.output_compression_level 5


                      I dis- and enabled pretty much every single line and then checking the error logs trying to find any clues. No luck so far.
                      All that is left, is reading into the whole syntax and use of .htaccess from scratch. There is nothing on the subject of subdomain FURLs in the modx documentation.