Port WordPress/Joomla from Apache to IIS 7
This WordPress blog as one Joomla website that I maintain, have been until now on Linux hosting and I decide it to port them to my Windows hosting provider. My Windows hosting provider of choice is Arvixe, I really like Arvixe because they are following new technologies, that I need. They even supporting .NET 4 Framework, ASP.NET MVC, Unlimited SQL Server database as olso unlimited MySQL 5 database.
So, how to port the widely known blog engine and CMS. It is very easy, because in my case Arvixe have installed Rewrite Module for IIS 7. Porting was easy, I just move the files from Linux server to Arvixe Windows server, and also create new database, dump old and import it to new, easily done with phpMyAdmin.
But, all the problem, is to port .htaccess and rewrite script in to the IIS Rewrite script. No big deal each site have scripts available, for the IIS (and Apache). In case of WordPress all is needed to put in web.config inside <system.webServer>:
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
And in case of Joomla, same thing but little different script and include disable chache for php:
<rewrite>
<rules>
<clear />
<rule name="Common Exploit Blocking" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAny">
<add input="{QUERY_STRING}" pattern="mosConfig_[a-zA-Z_]{1,21}(=|\%3D)" />
<add input="{QUERY_STRING}" pattern="base64_encode.*\(.*\)" />
<add input="{QUERY_STRING}" pattern="(\<|%3C).*script.*(\>|%3E)" />
<add input="{QUERY_STRING}" pattern="GLOBALS(=|\[|\%[0-9A-Z]{0,2})" />
<add input="{QUERY_STRING}" pattern="_REQUEST(=|\[|\%[0-9A-Z]{0,2})" />
</conditions>
<action type="Redirect" url="index.php" appendQueryString="false" redirectType="SeeOther" />
</rule>
<rule name="Joomla Search Rule" stopProcessing="true">
<match url="(.*)" ignoreCase="true" />
<conditions logicalGrouping="MatchAll">
<add input="{URL}" pattern="^/search.php" ignoreCase="true" />
</conditions>
<action type="Rewrite" url="/index.php?option=com_content&view=article&id=4" />
</rule>
<rule name="Joomla Main Rewrite Rule" stopProcessing="true">
<match url="(.*)" ignoreCase="true" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{URL}" pattern="(/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$" />
</conditions>
<action type="Rewrite" url="index.php/" />
</rule>
</rules>
</rewrite>
<caching>
<profiles>
<add extension=".php" policy="DisableCache" kernelCachePolicy="DisableCache" />
</profiles>
</caching>
Hope it helps!
Got anything to say? Go ahead and leave a comment!
WIDGETS NEEDED!
Go ahead and add some widgets here! Admin > Appearance > Widgets


Posted under: