1

Yesterday, I asked for help on urlrewrite - Ulrich Palha helped me to solve the problem.

His solution is working great on Linux server using .htaccess, and I appreciate his help, but the solution isn't working on a Windows server running IIS. I spent all day trying my best to make it work on a Windows server, but it was a bad day for me :-(, so I'm asking for help.

Here is code that works on Linux using .htaccess

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^([^/]*)/?([^/]*)/?([^/]*)\.html$ category.php?maincat_url=$1&first_subcat_url=$2&second_subcat_url=$3 [L]

Thanks.

  • 1
    What are you using on "Windows Server"? Apache? IIS? – vcsjones Nov 22 '11 at 13:38
  • sorry I forgot to told its IIS – prototype Nov 22 '11 at 13:49
  • check this: link – rankep Nov 22 '11 at 14:43
0

You need to install the free URL Rewrite module from Microsoft. Then you should add the following rewrite rule to the your web.config file:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Test" stopProcessing="true">
                    <match url="^([^/]*)/?([^/]*)/?([^/]*)\.html$" />
                    <action type="Rewrite" url="category.php?maincat_url={UrlEncode:{R:1}}&amp;first_subcat_url={UrlEncode:{R:2}}&amp;second_subcat_url={UrlEncode:{R:3}}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy