On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • I’ve been having problems with this as well and it took some time to figure it out. It definitely is a problem with friendly urls and 301 redirects inside the .htaccess file. We need to write the rule differently than the usual style. Here is a solution that worked for me:

    old page: SomeCategory/foo.asp
    new page: foo.html

    RewriteRule ^SomeCategory/foo.asp$ http://www.mydomain.com/foo.html [R=301,L]

    Hope this helps!
    • Yeah, the redirect in the previous post should work fine -- be sure to put it before the friendly URL redirect. I wouldn’t advise doing a 301 redirect to any page of the form index.php?q=123 because that creates duplicate content.
      • I just ran into the same problem as the OP. Here's my solution that worked when I updated the .htaccess file:

        Redirect 301 /texasroots https://www.example-site.com/index.php?id=260
        


        I had been trying to put this in the .htaccess redirect, but it wasn't working:

        Redirect 301 /texasroots https://www.example-site.com/texasroots.html
        


        Once I changed the redirect to the MODX ID (instead of putting the .html URL alias in the redirect: texasroots.html), it then worked just fine.
          Precision Web Development ... SmashStack.com
        • Just had the exact same problem.

          I was redirecting old URLs to the new ones with:
          RedirectPermanent /oldpage http://www.mydomain/newpage

          and got the ?q=oldpage in all my URLs

          The following code worked for me:
          RewriteRule ^oldpage$	http://www.mydomain/newpage?	[L,NC,R=301]


          The ? at the end of the newpage URL somehow prevents any further redirect.