views:

27

answers:

1

Hi,

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  A: 

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.

TonyCool