0
votes

I have a Modx htaccess file which needs to be rewritten from mod_rewrite to isapi_rewrite 2.

Can someone please help me? The following lines need to be changed for isapi_rewrite 2:

Options +FollowSymlinks RewriteEngine On RewriteBase /

RewriteCond %{HTTP_USER_AGENT} ^.internal\ dummy\ connection.$ [NC] RewriteRule .* - [F,L]

RewriteRule ^(manager|assets) - [L]

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

Many thanks.

1
Have you tried it? ISAPI Rewrite uses a very similar syntax to mod_rewrite. I don't believe Options, RewriteEngine or RewriteBase are supported, however, but I could be wrong. There is a similar property to RewriteBase - UriMatchPrefix, but RewriteEngine is not mentioned in the documentation. - Andy Shellam

1 Answers

1
votes

I would strongly recommend using ISAPI_Rewrite v3 as it has 99% mod_rewrite compatible syntax (from the above config only Options won't work) while ISAPI_Rewrite v2 doesn't support "RewriteCond %{REQUEST_FILENAME} !-f" and some other directives.

Also if you are on IIS 7 (7.5) you may use Helicon Ape which implements 30+ Apache modules (including mod_rewrite) on Windows systems. Ape will support the above config as is, without any modifications.