convert-htaccess-to-web-config-miva-merchant-9

OK here it is…

MIVA MERCHANT – HOW TO REDIRECT TO HOMEPAGE ON iiS WINDOWS SERVER:

I first posted this onto multiple developer forums and miva itself ( http://www.miva.com/forums/forum/online-merchants/miva-merchant-4-and-older/17223-how-to-find-or-change-homepage-url )

I found the solution at the end of this post.
################################

Does any know the redirect config for web.config on a iiS Windows box to make

This…

DirectoryIndex /mm5/merchant.mvc?Screen=SFNT

Work on a iiS box?

<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value=”index.html” />
<add value=”index.php” />
<add value=”Default.htm” />
<add value=”Default.asp” />
<add value=”index.htm” />
<add value=”iisstart.htm” />
<add value=”default.aspx” />
<add value=”index.cfm” />
</files>
</defaultDocument>
<handlers>
<remove name=”AboMapperCustom-72018″ />
<remove name=”AboMapperCustom-72017″ />
<remove name=”AboMapperCustom-72016″ />
<remove name=”AboMapperCustom-72015″ />
<remove name=”AboMapperCustom-72014″ />
<remove name=”AboMapperCustom-72013″ />
<remove name=”AboMapperCustom-72012″ />
<remove name=”AboMapperCustom-72011″ />
<remove name=”AboMapperCustom-72010″ />
<add name=”Miva Handler mapping” path=”*.mvc” verb=”*” modules=”MivaVMIIS7.dll” scriptProcessor=”C:\inetpub\mivavm-v5.22\bin\MivaVMIIS7.dll” resourceType=”Unspecified” requireAccess=”Script” preCondition=”bitness64″ />
</handlers>
<staticContent>
<clientCache cacheControlMaxAge=”30.00:00:00″ cacheControlMode=”UseMaxAge”/>
</staticContent>

<httpCompression directory=”%SystemDrive%\inetpub\
temp\IIS Temporary Compressed Files”>
<scheme name=”gzip” dll=”%Windir%\system32\inetsrv\gzip.dll”/>
<dynamicTypes>
<add mimeType=”text/*” enabled=”true”/>
<add mimeType=”message/*” enabled=”true”/>
<add mimeType=”application/javascript” enabled=”true”/>
<add mimeType=”*/*” enabled=”false”/>
</dynamicTypes>
<staticTypes>
<add mimeType=”text/*” enabled=”true”/>
<add mimeType=”message/*” enabled=”true”/>
<add mimeType=”application/javascript” enabled=”true”/>
<add mimeType=”*/*” enabled=”false”/>
</staticTypes>
</httpCompression>
<urlCompression doStaticCompression=”true” doDynamicCompression=”true”/>

<rewrite>
<rules>
<rule name=”rule 2J” stopProcessing=”true”>
<match url=”^product/([^/.]+).html$” />
<action type=”Rewrite” url=”//mm5/merchant.mvc?Screen=PROD&amp;Product_code={R:1}” appendQueryString=”true” />
</rule>
<rule name=”rule 3J” stopProcessing=”true”>
<match url=”^category/([^/.]+).html$” />
<action type=”Rewrite” url=”//mm5/merchant.mvc?Screen=CTGY&amp;Category_code={R:1}” appendQueryString=”true” />
</rule>
<rule name=”rule 4J” stopProcessing=”true”>
<match url=”^([^/]+)/([^/.]+).html$” />
<action type=”Rewrite” url=”//mm5/merchant.mvc?Screen=PROD&amp;Category_code={R:1}&a mp;Product_code={R:2}” appendQueryString=”true” />
</rule>
<rule name=”rule 5J” stopProcessing=”true”>
<match url=”^([^/.]+).html$” />
<action type=”Rewrite” url=”//mm5/merchant.mvc?Screen={R:1}” appendQueryString=”true” />
</rule>
</rules>
</rewrite>

</system.webServer>
<MivaScript>
<paths root=”C:\inetpub\99Perfume-Miva” data=”C:\inetpub\99Perfume-MivaData” ca=”C:\inetpub\mivavm-v5.22\certs\openssl-1.0″ />
<libraries>
<add library=”C:\inetpub\mivavm-v5.22\lib\builtins\MVBArchive.dll” />
<add library=”C:\inetpub\mivavm-v5.22\lib\builtins\MVBCrypto.dll” />
<add library=”C:\inetpub\mivavm-v5.22\lib\builtins\MVBFile.dll” />
<add library=”C:\inetpub\mivavm-v5.22\lib\builtins\MVBGD.dll” />
<add library=”C:\inetpub\mivavm-v5.22\lib\builtins\MVBLogging.dll” />
<add library=”C:\inetpub\mivavm-v5.22\lib\builtins\MVBMath.dll” />
<add library=”C:\inetpub\mivavm-v5.22\lib\builtins\MVBString.dll” />
<add library=”C:\inetpub\mivavm-v5.22\lib\builtins\MVBSystem.dll” />
<add library=”C:\inetpub\mivavm-v5.22\lib\builtins\MVBTemplate.dll” />
<add library=”C:\inetpub\mivavm-v5.22\lib\builtins\MVBTime.dll” />
<add type=”database” code=”MivaSQL” library=”C:\inetpub\mivavm-v5.22\lib\databases\mivasql.dll” />
<add type=”database” code=”MySQL” library=”C:\inetpub\mivavm-v5.22\lib\databases\MVDMYSQL.dll” />
<add type=”system” code=”GD” library=”C:\inetpub\mivavm-v5.22\lib\databases\BGD.DLL” />
</libraries>
</MivaScript>
</configuration>

##########  SOLUTION   ##########

After testing out multiple redirects, the solution is below…
a) create a text file called  web.config OR edit your existing document but make a backup of the original file just in case.
b) paste the code below into the document
c) upload to your Windows iiS Server

<rule name=”rule 1v” stopProcessing=”true”>
<match url=”^/*$” />
<action type=”Rewrite” url=”//mm5/merchant.mvc” />
</rule>

Adding this code to the web.config file if I now go to http://www.MYDOMAIN.com it will load the miva homepage without redirecting.

Thank you

NOTE: this configuration worked on a Windows 2000 iiS Server and may not work on your server.

James

– show quoted text –