We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7923
    • 4,213 Posts
    right, sorry.


      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
      • 33510
      • 13 Posts
      Well, this is the fix I’m sticking with for now. Maybe in a future release, the Devs should consider changing this particular variable to something more specific to MODx.

      But I have to say, that as a programmer first and a designer second, this CMS is EXACTLY what I was looking for. In fact, I started writing a SEOCMS, but abandoned it when I found MODx.
        • 22303 MODX Staff
        • 10,725 Posts
        The query string parameters used by standard (’id’) and friendly urls (’q’) will become configurable options with the release of 0.9.7.
          • 33510
          • 13 Posts
          Good to know! Thanks for the reply!
            • 4095
            • 372 Posts
            You mention having a Google Search Snippet, any chance you could share it?

            I have added the search box code on one page, and the search results on another page. With the hack below I now get redirected from the search box to the result page, but he results are empty sad

            Hoping your snippet resolves my problem.
              [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
              Admin Sandbox Login: sandbox Password: castle
              • 4095
              • 372 Posts
              Be interested to see if anyone else is using Google Co-op?

              I still have’nt resolved my issue of getting no results on the search results page .

              The domain is www.emanz.ac.nz and the page is search.html, the results page is results.html is anyone can assist or has a snippet.

              Thanks smiley

              (This is the 66th most viewed topic in this thread, I’m sure I can’t be the only one)
                [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
                Admin Sandbox Login: sandbox Password: castle
                • 10449
                • 956 Posts
                The most simple and effective hack is to simply use Q for Google-search, it will still work (uppercase; Q instead of q). This has been discussed several times in other threads already.
                  • 4095
                  • 372 Posts
                  Thanks for your response. I did have a search but couldn’t find anything, so sorry for bringing it up again.

                  If I don’t alter MODX or the Google code, I get a 404 error on the result page. If I change the Google code to use Q instead of q as per your suggestion, or if I hack the ’document.parser.class.inc.php’ as er below; I get the page displayed, but with no content (search results).

                  The code is being inserted as I can see it on the page source, and the search engine works as tested at http://www.google.com/coop/cse?cx=011543662248294972723%3Amadc5jdobbq

                  Turning off FRULs makes no difference, so really am lost.
                    [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
                    Admin Sandbox Login: sandbox Password: castle
                    • 32645
                    • 377 Posts
                    Can I get clarification on this issue regarding Google Custom Search.

                    I tried to put a GCS onto my modx pages, but it kept reporting a 404 error.

                    From searching it appears that the problem is MODx, or the htaccess file.

                    In this thread, it suggests changing the Prefix for friendly URLs: to "page", yet another person says simply changing the rewrite rules from:

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


                    to:

                    RewriteRule ^(.*)$ index.php?Q=$1 [L,QSA]
                    


                    works just as well.

                    Can anyone clarify this, as I don’t want to be messing around with my live site to see if this works.

                    Thanks.

                    ----

                    Some quick reports from some tests.


                    Turning;

                    
                    from:
                    <input type="text" name="q" size="31" />
                    
                    to:
                    <input type="text" name="Q" size="31" />
                    


                    Makes GCS return to the homepage.

                    Turning:

                    # htaccess
                    # from
                    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
                    
                    to:
                    RewriteRule ^(.*)$ index.php?Q=$1 [L,QSA]
                    


                    and with FURLs on, makes the website not load any pages.

                    Is there any other fixes?
                      • 32645
                      • 377 Posts
                      I hacked a solution, similar to an earlier posting.

                      1) Changed the .htaccess from:

                      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
                      to:
                      RewriteRule ^(.*)$ index.php?p=$1 [L,QSA]
                      


                      2) Changed all occurances of $_REQUEST[’q’] to $_REQUEST[’p’] in the "manager/includes/document.parser.class.inc.php" file. There are multiple occurances.

                      I was then able to get Google Custom Search to work!