We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24732 ☆ A M B ☆
    • 300 Posts
    Hi guys,

    I have a site, cafe.iuhealthlearning.org that has to be a subdomain. I set up the subdomain using cpanel.

    so I fought with fURLs all morning.

    basically if a url was cafe.iuhealthlearning.org/learning-resources/ it didn't work
    but cafe.iuhealthlearning.org/learning-resources does work. So I updated the setting that adds the trailing slash to containers and voila. problem solved.

    But I'm using Discuss.

    I had to disable discuss because obviously, the rewrite rules for it broke it.

    now have to go to a meeting. gotta fix this asap.

    I did this:
    http://rtfm.modx.com/revolution/2.x/administering-your-site/contexts/creating-a-subdomain-from-a-folder-using-virtual-hosts

    for the web context. Added the settings listed there.

    htaccess is here:

    # 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]
    
    RewriteEngine On
    RewriteBase /
    
    # If imported from SMF, you can include the following lines to make sure existing urls don't break.
    RewriteRule ^forums/index.php/topic,(.*).msg(.*).html$ forums/?action=thread&thread=$1&i=1
    RewriteRule ^forums/index.php/topic,(.*).(.*).html$ forums/?action=thread&thread=$1&i=1&start=$2
    RewriteRule ^forums/\?topic=(.+).(.+)$ forums/?action=thread&thread=$1&i=1
    RewriteRule ^forums/index.php/board,(.*).(.*).html$ forums/?action=board&board=$1&i=1&start=$2
    RewriteRule ^forums/\?board=(.+).(.+)$ forums/?action=board&board=$1&i=1
     
     
    # Discuss rewrite rules
    RewriteRule ^forums/thread/([0-9]+)/(.*)$ forums/?action=thread&thread=$1 [L,QSA]
    RewriteRule ^forums/u/(.+)$ forums/?action=user&user=$1 [L,QSA]
    RewriteRule ^forums/board/([0-9]+)/(.*)$ forums/?action=board&board=$1 [L,QSA]
    RewriteRule ^forums/category/([0-9]+)/(.*)$ forums/?category=$1 [L,QSA]
    RewriteRule ^forums/(.+)$ forums/?action=$1 [L,QSA]
    RewriteRule ^forums/(.+)/$ forums/?action=$1 [L,QSA]
    
    # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
    #RewriteCond %{HTTP_HOST} .
    #RewriteCond %{HTTP_HOST} !^cafe\.iuhealthlearning\.com [NC]
    #RewriteRule (.*) http://cafe\.iuhealthlearning.com/$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://example-domain-please-change.com/$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
    
    


    all help gratefully accepted.
      ________

      Anne
      Toad-in-Chief
      Red Toad Media - Web Design, Louisville KY
      Hear me tweet: http://www.twitter.com/redtoadmedia
      "Bring on the imperialistic condiments." - Rory Gilmore
      • 3749
      • 24,544 Posts
      Can you post an example of a Discuss URL that no longer works and (if possible) a version of it that does work with your current setup?
        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
        • 24732 ☆ A M B ☆
        • 300 Posts
        none of the forums work right now, yes will enable it...

        http://cafe.iuhealthlearning.com/forums.html

        username Manager
        password asdf1234

        the main page is fine but all css/js is broken if you click on posts, etc
          ________

          Anne
          Toad-in-Chief
          Red Toad Media - Web Design, Louisville KY
          Hear me tweet: http://www.twitter.com/redtoadmedia
          "Bring on the imperialistic condiments." - Rory Gilmore
          • 3749
          • 24,544 Posts
          Do a "View Source" on a bad page and see what the CSS and JS links are.
            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
            • 24732 ☆ A M B ☆
            • 300 Posts
            yes, they are broken however the issue is that I need them rewritten one way for the site and another for the forums. I knew that.
              ________

              Anne
              Toad-in-Chief
              Red Toad Media - Web Design, Louisville KY
              Hear me tweet: http://www.twitter.com/redtoadmedia
              "Bring on the imperialistic condiments." - Rory Gilmore
              • 3749
              • 24,544 Posts
              Are you sure you want your Manager username and password posted on a public forum? wink
                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
                • 24732 ☆ A M B ☆
                • 300 Posts
                that isnt my manager username and password. it is a test forum moderator account and cant really do much other than delete test posts and see pdfs of instructional materials. Have at it. LOL. but thanks. I know I come off as a ditz but am not that goofy. Anyhow, YJ gave me some direction last night, will post here for edification of community.

                Apparently buried in core/config/config.inc.php there is a definition for hostname that is set by initial set up process. if I change it there and undo my workarounds hopefully I will be good to go.

                and that test forum admin account will be gone soon ;-) [ed. note: redtoad last edited this post 13 years ago.]
                  ________

                  Anne
                  Toad-in-Chief
                  Red Toad Media - Web Design, Louisville KY
                  Hear me tweet: http://www.twitter.com/redtoadmedia
                  "Bring on the imperialistic condiments." - Rory Gilmore
                  • 24732 ☆ A M B ☆
                  • 300 Posts
                  Quote from: redtoad at Sep 04, 2013, 10:34 AM
                  that isnt my manager username and password. it is a test forum moderator account and cant really do much other than delete test posts and see pdfs of instructional materials. Have at it. LOL. but thanks. I know I come off as a ditz but am not that goofy. Anyhow, YJ gave me some direction last night, will post here for edification of community.

                  Apparently buried in core/config/config.inc.php there is a definition for hostname that is set by initial set up process. if I change it there and undo my workarounds hopefully I will be good to go.

                  and that test forum admin account will be gone soon ;-)
                    ________

                    Anne
                    Toad-in-Chief
                    Red Toad Media - Web Design, Louisville KY
                    Hear me tweet: http://www.twitter.com/redtoadmedia
                    "Bring on the imperialistic condiments." - Rory Gilmore
                    • 24732 ☆ A M B ☆
                    • 300 Posts
                    and I finally figured it out.

                    the answer of course was silly.

                    I had hardcoded in the base_url and not changed it to <base href="[[!++site_url]]">

                    on my Discuss template.

                    all is well now. whew.
                      ________

                      Anne
                      Toad-in-Chief
                      Red Toad Media - Web Design, Louisville KY
                      Hear me tweet: http://www.twitter.com/redtoadmedia
                      "Bring on the imperialistic condiments." - Rory Gilmore
                      • 24732 ☆ A M B ☆
                      • 300 Posts
                      okay, all is not well,

                      I found the space at the end of my url in my context settings.

                      have opened up permissions on this.

                      http://cafe.iuhealthlearning.com/forums/

                      have to have this done within a couple hours, have to sleep.

                      Since I have moved the site from subdomain /modx to /cafe, the sub forum links do not work ...404 error, goes back to home.

                      is there some weird place where there is a setting I have overlooked? found discuss file path in system settings and changed it already.

                      tia

                      A
                        ________

                        Anne
                        Toad-in-Chief
                        Red Toad Media - Web Design, Louisville KY
                        Hear me tweet: http://www.twitter.com/redtoadmedia
                        "Bring on the imperialistic condiments." - Rory Gilmore