If you want to host MyBB on a Windows Server with IIS instead of a Linux server with Apache, you’ll need a web.config file instead of a .htaccess file for seo-friendly URLs. Windows Servers are often used in intranet solutions and MyBB can extend intranets very well.
This is a sample web.config file content for MyBB, you might need to adjust the paths if you don’t place the file in your MyBB root.
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <httpErrors existingResponse="PassThrough" /> <rewrite> <rules> <rule name="Rule 1" stopProcessing="true"> <match url="^forum-([0-9]+)\.html$" ignoreCase="false" /> <action type="Rewrite" url="forumdisplay.php?fid={R:1}" appendQueryString="true" /> </rule> <rule name="Rule 2" stopProcessing="true"> <match url="^forum-([0-9]+)-page-([0-9]+)\.html$" ignoreCase="false" /> <action type="Rewrite" url="forumdisplay.php?fid={R:1}&page={R:2}" appendQueryString="true" /> </rule> <rule name="Rule 3" stopProcessing="true"> <match url="^thread-([0-9]+)\.html$" ignoreCase="false" /> <action type="Rewrite" url="showthread.php?tid={R:1}" appendQueryString="true" /> </rule> <rule name="Rule 4" stopProcessing="true"> <match url="^thread-([0-9]+)-page-([0-9]+)\.html$" ignoreCase="false" /> <action type="Rewrite" url="showthread.php?tid={R:1}&page={R:2}" appendQueryString="true" /> </rule> <rule name="Rule 5" stopProcessing="true"> <match url="^thread-([0-9]+)-lastpost\.html$" ignoreCase="false" /> <action type="Rewrite" url="showthread.php?tid={R:1}&action=lastpost" appendQueryString="true" /> </rule> <rule name="Rule 6" stopProcessing="true"> <match url="^thread-([0-9]+)-nextnewest\.html$" ignoreCase="false" /> <action type="Rewrite" url="showthread.php?tid={R:1}&action=nextnewest" appendQueryString="true" /> </rule> <rule name="Rule 7" stopProcessing="true"> <match url="^thread-([0-9]+)-nextoldest\.html$" ignoreCase="false" /> <action type="Rewrite" url="showthread.php?tid={R:1}&action=nextoldest" appendQueryString="true" /> </rule> <rule name="Rule 8" stopProcessing="true"> <match url="^thread-([0-9]+)-newpost\.html$" ignoreCase="false" /> <action type="Rewrite" url="showthread.php?tid={R:1}&action=newpost" appendQueryString="true" /> </rule> <rule name="Rule 9" stopProcessing="true"> <match url="^thread-([0-9]+)-post-([0-9]+)\.html$" ignoreCase="false" /> <action type="Rewrite" url="showthread.php?tid={R:1}&pid={R:2}" appendQueryString="true" /> </rule> <rule name="Rule 10" stopProcessing="true"> <match url="^post-([0-9]+)\.html$" ignoreCase="false" /> <action type="Rewrite" url="showthread.php?pid={R:1}" appendQueryString="true" /> </rule> <rule name="Rule 11" stopProcessing="true"> <match url="^announcement-([0-9]+)\.html$" ignoreCase="false" /> <action type="Rewrite" url="announcements.php?aid={R:1}" appendQueryString="true" /> </rule> <rule name="Rule 12" stopProcessing="true"> <match url="^user-([0-9]+)\.html$" ignoreCase="false" /> <action type="Rewrite" url="member.php?action=profile&uid={R:1}" appendQueryString="true" /> </rule> <rule name="Rule 13" stopProcessing="true"> <match url="^calendar-([0-9]+)\.html$" ignoreCase="false" /> <action type="Rewrite" url="calendar.php?calendar={R:1}" appendQueryString="true" /> </rule> <rule name="Rule 14" stopProcessing="true"> <match url="^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)\.html$" ignoreCase="false" /> <action type="Rewrite" url="calendar.php?calendar={R:1}&year={R:2}&month={R:3}" appendQueryString="true" /> </rule> <rule name="Rule 15" stopProcessing="true"> <match url="^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+)\.html$" ignoreCase="false" /> <action type="Rewrite" url="calendar.php?action=dayview&calendar={R:1}&year={R:2}&month={R:3}&day={R:4}" appendQueryString="true" /> </rule> <rule name="Rule 16" stopProcessing="true"> <match url="^calendar-([0-9]+)-week-(n?[0-9]+)\.html$" ignoreCase="false" /> <action type="Rewrite" url="calendar.php?action=weekview&calendar={R:1}&week={R:2}" appendQueryString="true" /> </rule> <rule name="Rule 17" stopProcessing="true"> <match url="^event-([0-9]+)\.html$" ignoreCase="false" /> <action type="Rewrite" url="calendar.php?action=event&eid={R:1}" appendQueryString="true" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
Note that this will also push PHP errors to your MyBB with the httpErrors line. Otherwise, you’d get a 500 internal server error and not the useful MyBB errors with proper formatting.
You can now use your MyBB on a Windows Server without any issues. Use MyBB for Business!