On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • I've read that MODX Cloud doesn't support .htaccess files.

    This means that I cannot set the http headers in the htaccess file to: Header set X-UA-Compatible "IE=edge,chrome=1"
    I need this rule to prevent the use of a meta tag for this. The meta tag will do the same job, but will not validate, that's why I'm not keen on using it.

    So is there a way to set these headers while still using the Cloud?
    • Quote from: markpostema at Jan 14, 2013, 02:01 PM
      X-UA-Compatible "IE=edge,chrome=1

      I was reading on the HTML5 boilerplate GitHub issues that they're likely to remove this altogether shortly from their code and not bother trying to force Chrome frame on users in old browsers, as well as old IE conditional comments, etc. I haven't bothered with this for a while, either in .htaccess or meta tags. Are you specifically having to make stuff work in IE6?

      https://github.com/h5bp/html5-boilerplate/issues/1290
      https://github.com/h5bp/html5-boilerplate/issues/1187
      • Quote from: pdincubus at Jan 14, 2013, 02:08 PM
        Quote from: markpostema at Jan 14, 2013, 02:01 PM
        X-UA-Compatible "IE=edge,chrome=1
        I haven't bothered with this for a while, either in .htaccess or meta tags. Are you specifically having to make stuff work in IE6?

        The IE=Edge is more to do with user in the latest versions of IE. I had a client where they had IE9 installed but compatibility mode was constantly getting turned on causing it to look like IE7. Your link to 1187 issue actually explains why the meta tag was getting ignored, was driving me nut. It was one of the reasons why i had to add the header in the .htaccess file.


        @markpostema

        I've actually just asked a similar question (via modxcloud help) but in regards to expiring headers and they've given me this link which also cover adding headers:
        http://nginx.org/en/docs/http/ngx_http_headers_module.html

        Still working on sussing out exactly what i need to write. But seems as if you drop this into the same place as you'd place the URL rewrite in modx cloud.

        Also it was mentioned that they are working on some documentation, which i think is badly needed.
        • Quote from: bennyb at Jan 15, 2013, 07:32 PM
          Your link to 1187 issue actually explains why the meta tag was getting ignored, was driving me nut. It was one of the reasons why i had to add the header in the .htaccess file..

          Yeah, I didn't know that either until I found that issue on their GitHub account. Useful to know.

          I supposed you could have the best of both worlds by having the IE conditional classes on the body as in the suggestions on that issue, and keep the meta tag if you definitely require its use and can't use a .htaccess? Not 100% what you'd want but it would get around the problem without breaking anything!
          • I've found a PHP solution to this. The following rule has to be added at the top of the config.core.php in the root of the site:
            header('X-UA-Compatible: IE=edge,chrome=1');
            • Something along these lines should work with the url rewrites box in Cloud (untested);

              location / {
                add_header X-UA-Compatible IE=edge,chrome=1;
                try_files $uri $uri/ @modx-rewrite;
              }


              And for adding expires to assets (untested again):
              location/assets/ {
                expires 7d;
                try_files $uri $uri/ @modx-rewrite;
              }
              location / {
                try_files $uri $uri/ @modx-rewrite;
              }


              (http://wiki.nginx.org/HttpHeadersModule)

              Also it was mentioned that they are working on some documentation, which i think is badly needed.
              It's being reviewed so will likely come online real soon. tongue
                Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
              • Quote from: markh at Jan 16, 2013, 02:19 PM


                location / {
                  add_header X-UA-Compatible IE=edge,chrome=1;
                  try_files $uri $uri/ @modx-rewrite;
                }



                That add_header in Mark's example actually (not sure just why) does not work in the location / {} block in Cloud. It works outside of it or in other location blocks though. So, try
                  add_header X-UA-Compatible IE=edge,chrome=1;
                  location / {
                    try_files $uri $uri/ @modx-rewrite;
                  }
                


                Documentation being pushed to the website very very soon smiley
                  Mike Schell
                  Lead Developer, MODX Cloud
                  Email: mike@modx.com
                  GitHub: https://github.com/netProphET/
                  Twitter: @mkschell
                  • Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                    Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                  • Quote from: markh at Jan 16, 2013, 11:51 PM
                    Documentation live: https://modxcloud.com/userguide/how-tos/web-rules-rewrites-redirects-tweaks.html

                    Great!!!