We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17897
    • 46 Posts
    As the title suggests I am having a potential issue with Friendly URLs and a query string used in the blog on my site. I’ve set it up basically according to the tutorial by Shawn McCormick, and got it all working except that the tags links return a 404 error. I’ve been posting about this in the thread (http://modxcms.com/forums/index.php/topic,54671.20.html) for said tutorial, but no one seems to have an idea. I have been suspecting the last couple of days that it has something to do with friendly urls, I’m just wondering if this is something one of the IIS pros here can help with. If it is an issue with FURLs that is.

    My setup:
    IIS 6
    modX 2.0.4
    IIRF handling rewrites
    MySQL server 5.1.44 (client 5.0.7)
    PHP 5.3.3

    My IIRF.ini:
    RewriteEngine On
    RewriteBase /
    
    # The Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] 


    FURLs are working fine with the aliases set for each document and such. It is just that the links with ?tag=news&key=tags return 404 errors as opposed to a blank content on the blog page. Thus I am thinking it is a configuration issue as opposed to a getResources or other snippet issue (if I am wrong, please say so!). If anyone could help out, I’d really appreciate it, I have been at this state (99% completed blog setup) for nearly a week now with no progress!

    Apologies if this is considered a double-post across 2 forums, I’m just wondering if it is a separate issue.
      • 17897
      • 46 Posts
      Alright, this is DEFINITELY a Friendly URLs issue. I turned off friendly URLs in the modX settings, and what do you know, the tag links work now. I am not all that familiar with rewrite rules (or regular expressions for that matter), but I am guessing the problem lies there? Should I be changing something in the IIRF.ini?
        • 17897
        • 46 Posts
        This appears to be an issue others have had. http://modxcms.com/forums/index.php?topic=50608.0 is one such issue, where the query string with friendly URLs on IIS returns a 404. There are other such threads on the forums here as well, all dealing with IIS and Friendly URLs. What is really annoying me is that in all such threads, as soon as this issue is mentioned, the thread ENDS. Surely someone has a fix for this? Or is it a known bug? I have loved modX so far despite the learning curve (it has taken a while to get used to it, but I am beginning to get there), but if this cannot be made to work, then I will have to jettison the last 2 months’ worth of work and look elsewhere. I don’t want to have to do this, but given the lack of responses on this issue, I may have to...
          • 16942
          • 33 Posts
          I see so many threads like this on the modx forums.

          However the most effective way I’ve found of getting support for these "Is it a bug?" situations is to file it as a bug (click on Bugs, above, create an account if need be and then full describe your steps to repro). The core dev team will then check it out and if it turns out not to be a bug, you’ll be pointed in the right direction for more information.

          MODx has a plenty of unreported bugs - it’s up to us to report them and have the experts assess.

          Good luck!
            • 17897
            • 46 Posts
            Yes, well it turned out to be a quirk of IIRF and/or the default rule from modX. I used the below rule in place of the default one that ships with modX per the developer of IIRF and it works great, the site is actually live now. What finally turned me on to getting to the IIRF developer was seeing the rewrite log rewriting URLs several times...if people use the normal rule with Apache and query strings, then I guess it was an IIRF quirk, otherwise maybe just a bad rule. Either way, I got it working, it just took over a month of head-banging and bugging about 50 people...

            Now that I have it working, I am going to try to get a step-by-step up for getting IIRF working with modX, it actually works pretty well aside from the one issue.

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