We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25357
    • 92 Posts
    This should work, but doesn’t:

    http://modxcms.com/forums/index.php?topic=54236.0

    I get an infinite loop.

    Apache server, mod_rewrite fine, FURL’s enabled, all fine. Web context is at domain root. Of course all managed by index.php, and ultimately,

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


    Marketing manager demands that /index.php rewrites to /, and there hangs the problem.

    Here’s an infinite loop:

    RewriteCond ^index.php$ / [R=301,L,NC]

    even:

    RewriteCond %{REQUEST_URI} ^/index.php [R=301,L,NC]
    RewriteRule $ http://www.example.com [R=301,L]

    I know why it’s impossible (I think) but can’t locate anyone’s previous experiences with this or how they fixed it. Any suggestions?
      • 22303 MODX Staff
      • 10,725 Posts
      If you are using Revolution, you do not need this rule; MODx automatically redirects to the actual URL if you go to index.php. If it includes ?id=1, it will render in place, so if you wanted to redirect only those requests, you could (though you couldn’t direct it to the friendly URL corresponding to the id anyway), but it’s better simply to never reveal such links to the world and you don’t have to worry about it.