We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17897
    • 46 Posts
    Alright here goes. I enabled friendly URLs in my Revo installation a couple weeks ago. That worked fine, the URLs rewrite nicely to the alias with alias path and so on. All page links work perfectly. However, I then set up a blog following Shaun McCormick’s tutorial. There were a few bumps along the way, but I got the scripts working. They output the posts and the post listings and so on. I can customize them later once I get the following problem resolved: the tagLister links are not being rewritten properly. They always return a 404 error. I enabled logging in my rewrite file to see what was happening and found that the following was being sent as the rewritten URL to modX:
    Sun Jan 30 11:28:40 -  3256 - DoRewrites: Rewrite Url to: '/index.php?q=index.php?q=blog.html?tag=news&key=tags&tag=news&key=tags&q=blog.html?tag=news&key=tags&tag=news&key=tags'


    Obviously, this is not quite what I am looking for! Note that all other URL rewrites occur fine, just the tag ones, I suspect it has something to do with the query string? If I turn off Friendly URLs, everything behaves fine. Do I need to add some new rewrite rules? I am totally unfamiliar with rewrite rules, I just pulled the main ones from the ht.access and it all worked. I understand basically what it is doing, but not enough to try to fix it.

    Honestly, I would be perfectly happy with a rule that would rewrite the tag links to something like /blog/tags-TAGNAME, but I would also be fine with the normal blog.html?tags=TAGNAME. Preferably without the &key=tags, but whatever ends up working. I don’t really want to have FURLs off though.

    My setup:
    IIS 6
    Revo 2.0.7-pl traditional
    MySql 5.1.44 (5.0.7 client)
    PHP 5.3.3

    Using IIRF for rewrites, my IIRF.ini:
    # Vital components of your .htaccess file
    RewriteEngine On
    RewriteBase /
    
    # The Friendly URLs part
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    


    FURL settings:
    Use Friendly URLs: Yes
    Use Friendly Aliases: Yes
    Use Friendly Alias Path: Yes
    Allow Duplicate Alias: Yes
    Automatically Generate Alias: Yes

    Anyone have an idea? I’ve combed the forums here and not found a solution that works.
      • 17897
      • 46 Posts
      Nothing? Really? I should think that someone at least has a way to rewrite without using the query string. I realize a snippet/chunk is likely needed to generate the friendly links, some guidance would really be appreciated. This glitch is the last big thing holding me up from converting my site over live...
        • 17897
        • 46 Posts
        So I have the URLs outputting nicely to [site_root]/blog/tags/tag-name by changing the template for the toLinks snippet to
        <a href="[[~[[+target]]]]tags/[[+item]]" class="[[+cls]]">[[+item]]</a>

        and by adding one line to the toLinks snippet:
        $itemArray['target'] = $target;


        This works great, so I just need to figure out the rewrite issue, which is where I need HELP! I tried adding this line:
        RewriteRule ^tags/([A-Za-z0-9]+)$ ?tag=$1 [L,QSA]

        per the discussion http://modxcms.com/forums/index.php?topic=56749.0"" target="_blank" rel="nofollow">here, but I am either adding it to the wrong place in my iirf.ini or I need to change some other rules as well.

        Could someone please help me out here? This is been nearly 3 weeks like this. Thanks!