MODx .htaccess rewrite

Topics: User Forum
Sep 23, 2007 at 12:37 PM

Im trying to rewrite the .htaccess of MODx ( to a Ionics Isapi Rewrite .ini to get SEO friendly urls but so far it just wont work.

Ive tried this:

RewriteBase /subdomain

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

This should make it like this: >

But unfortunatly it wont work (doesnt do anything). Ive tried to search the readme but still nothing. Does somebody have an idea on how to do this?? Maybe other MODx users need this info too..

Thanks in advance,

Oct 7, 2007 at 10:46 AM
BUMP anybody?
Oct 9, 2008 at 12:13 AM
I ran into a similar issue myself. The problem is that the filter doesn't understand the QSA modifier, which appends the query string of the input URL to the output URL, so the url

would map to

instead of

However, this can be worked around by adding a second rule. Here's what worked for me:

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

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

Oct 14, 2008 at 4:02 AM
Thanks for that - good tip.
Aug 14, 2009 at 3:09 PM

just a quick note - QSA is now supported by IIRF.