We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3384
    • 9 Posts
    Hi All. I’m setting up a site on IIS6 and everything was going good until now. I set up friendly URLs, thanks to this post - http://modxcms.com/forums/index.php/topic,3119.0.html

    Now i just noticed that the FCK editor is not working. It has a 404 not found error message within the frame when i go to edit a page through the MODx manager. I’m not sure if this is a IIS issue but when i tested the site on Apache it was working fine.

    Has anyone come across this problem before?
      • 37550 ☆ A M B ☆
      • 711 Posts
      onesmarthost Reply #2, 17 years ago
      Hi BillyBear,

      The problem is that your ISAPI Rewrite rules are processing in sub folders of your site i.e. /Manager/ and FCKEditor uses .html files in some places which are getting redirected to your index.php

      What version of ISAPI Rewrite are you using? if you are using v3 this rule set will work fine for you:


      RewriteRule ^/(?!(?:manager|assets)/)(.*)\.html(?:\?(.*))?$ /index.php?q=$1?2&$2: [NC,L,U]

      If you need to exclude more folders from the rewrite rule you can add them like so


      RewriteRule ^/(?!(?:manager|assets|testfolder)/)(.*)\.html(?:\?(.*))?$ /index.php?q=$1?2&$2: [NC,L,U]

      Hope that helps

      Aaron
        http://www.onesmarthost.co.uk
        UK MODX Hosting with love.
        • 3384
        • 9 Posts
        Hi Aaron,

        Many thanks for your quick reply.

        Currently i’m using IIRF ( ionics isapi rewrite filter ) because it’s free and i need to keep the costs down as much as poss. The ini file has the following -

        # SE Friendly URLs
        RewriteEngine On
        Rewrite Rule ^/manager/.* - [L]
        Rewrite Rule ^/assets/.* - [L]
        RewriteRule /(.*).html /index.php?q=$1

        Do i just replace it with the code you posted or do i add it?

        Also if i wanted to set up 301 redirects for pages that no longer exists how would i go about doing this?
        Currently i’m using -

        # 301 redirect old pages
        RewriteCond %{HTTP_HOST} ^www.mydomain.co.uk/default.aspx$
        RedirectRule ^/(.*)$ http://www.mydomain.co.uk/$1 [R=301]

        RewriteCond %{HTTP_HOST} ^mydomain.co.uk/default.aspx$
        RedirectRule ^/(.*)$ http://www.mydomain.co.uk/$1 [R=301]

        RewriteCond %{HTTP_HOST} ^/olddirectory/oldpage.aspx$
        RedirectRule ^/(.*)$ http://www.mydomain.co.uk/new-page.html$1 [R=301]

        However this is not working. It just give me a 404.
          • 37550 ☆ A M B ☆
          • 711 Posts
          onesmarthost Reply #4, 17 years ago
          In theory the rules should be the same between different systems:

          Try this complete file:


          RewriteEngine On
          RewriteCompatibility2 On
          RepeatLimit 32
          RewriteBase


          # Block external access to the httpd.ini and httpd.parse.errors files
          RewriteRule ^/httpd(?:\.ini|\.parse\.errors).*$ / [NC,F,O]

          # Block external access to the Helper ISAPI Extension
          RewriteRule ^.*\.isrwhlp$ / [NC,F,O]


          RewriteRule ^/oldpagename.html$ /newpagename.html [NC,R=301]

          # example of a rule on onesmarthost.co.uk
          #RewriteRule ^/modx-hosting.html$ /modx-hosting-offer.html [NC,R=301]

          RewriteRule ^/(?!(?:manager|assets)/)(.*)\.html(?:\?(.*))?$ /index.php?q=$1?2&$2: [NC,L,U]

            http://www.onesmarthost.co.uk
            UK MODX Hosting with love.
            • 3384
            • 9 Posts
            :’(

            Ok i tried that complete code and i’m sorry but the url rewrites are not working now. The pages are coming up with 404s.

            Before the URL rewrite was working, it was just the FCK editor and the 301 redirects from the old pages that needed to be fixed.

            The post where i got the first set of rules from - http://modxcms.com/forums/index.php/topic,3119.0.html states that it leaves the manager and assets folders untouched for rewrites.

            Sorry but i’m such a newbie with rewrite rules.
              • 37550 ☆ A M B ☆
              • 711 Posts
              onesmarthost Reply #6, 17 years ago
              Hi BillyBear

              I guess one way to test your original rules would be for you to create a test.html file in a subfolder of manager i.e. /manager/includes/test.html and have it out put some text i.e.

              <h1>testing</h1>

              Then from your browser try to access www.yoursite.com/manager/includes/test.html does this give you a 404 error?
                http://www.onesmarthost.co.uk
                UK MODX Hosting with love.
                • 3384
                • 9 Posts
                Hi Aaron,

                I’ve just done exactly as you said and uploaded a test.html file into the manager/includes/ directory.

                When i try to access the page in my browser, i do get a 404

                :’(
                  • 3384
                  • 9 Posts
                  hmmm... i’ve just noticed an error in my original code - "Rewrite Rule".

                  There shouldn’t be a space, it should be one word. So i’m gonna change this now.
                    • 3384
                    • 9 Posts
                    Solved!! It was the space in "Rewrite Rule" that was causing the problem.

                    Many thanks for your help.