• Register
Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Solved: IIS7 URL Rewrite

0 votes

Earlier there was a post asking if Q2A works on IIS with PHP installed.  There was a comment that read it works fine other than the url rewrite portion.

This works, but you have to create a custom web.config file for the directory where Q2A is installed.  It pretty much mimics the code that the htacess file would have on an apache server.

Below is the web.config file that needs to be placed in your Q2A directory.  Also make sure you have the first option selected for your url structure in your Q2A admin.


<?xml version="1.0" encoding="UTF-8"?>
                <rule name="Question2Answer" stopProcessing="true">
                    <match url="." ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{URL}" pattern="^(.*)//(.*)$" ignoreCase="false" />
                    <action type="Redirect" url="{C:1}/{C:2}" redirectType="Permanent" />
                <rule name="Question2Answer2" stopProcessing="true">
                    <match url="^.*$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                    <action type="Rewrite" url="index.php?qa-rewrite={R:0}&amp;{QUERY_STRING}" appendQueryString="false" />


asked Nov 14, 2010 in Q2A Core by Frank Basti
Allas, this causes server 500 errors for my IIS7 configuration running on Windows 2008R2.  What IIS / server configuration were you using that this worked on?
Caused a crash because this REQUIRES the Query Rewrite module be installed to your IIS... http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/

3 Answers

0 votes

When i choose first option selected for url structure i get:

11111The page cannot be found

Anybody knew what problem it could be?

answered Mar 3, 2011 by Registered user 2
I get the same error "The page cannot be found", how do you fix this??
0 votes
Bravo!!!Thanks for your tip and code, i really need it. Slove my problem one and for all. thanks (^_^)
answered Jul 7, 2011 by Kok Kheng
Excellent that solved my problem as well...learned programming now
0 votes
It seams that this does not work with german Umlaute:

Ä, ö, ü ...
answered Jul 27, 2012 by krafttrain
I have same proplem. How to fix it?