Rectangle 27 2

<system.webServer>
        <modules runAllManagedModulesForAllRequests=true>
            <add name=UrlRewriter type=Intelligencia.UrlRewriter.RewriterHttpModule />
        </modules>
        <validation validateIntegratedModeConfiguration=false />
    </system.webServer>

Please put this code block somewhere under <configuration> section.

It worked, what exactly would be the explanation for this?

<system.webServer> webconfig section is used to specify IIS settings for this particular application. This will ensure that the UrlRewriter.Net module from Intelligencia, which was written before IIS7 shipped, will be called and have a chance to re-write all URL requests to the server (including for folders).

What is really cool about the above web.config file is that: 1) It will work on any IIS 7.0 machine. You don't need an administrator to enable anything on the remote host. It will also work in medium trust shared hosting scenarios. 2) Because I've configured the UrlRewriter in both the <httpModules> and IIS7 <modules> section, I can use the same URL Rewriting rules for both the built-in VS web-server as well as on IIS7. Both fully support extension-less URLRewriting. This makes testing and development really easy.

iis 7 - asp.net rewrite url logic works locally but not on server give...

asp.net iis-7 url-rewriting http-status-code-404
Rectangle 27 4

I had the same issue when moving a web application from IIS 7 to 8, and I solved it by installing the URL Rewrite module, which I had completely forgot. So check that you have the correct modules etc. installed on your new server/IIS.

You can install this module with WPI (Web Platform Installer) also.

iis 8 - IIS 8.0 ASP.NET and Error 500.19 - Stack Overflow

asp.net iis-8
Rectangle 27 0

<system.webServer>
        <modules runAllManagedModulesForAllRequests=true>
            <add name=UrlRewriter type=Intelligencia.UrlRewriter.RewriterHttpModule />
        </modules>
        <validation validateIntegratedModeConfiguration=false />
    </system.webServer>

Please put this code block somewhere under <configuration> section.

It worked, what exactly would be the explanation for this?

<system.webServer> webconfig section is used to specify IIS settings for this particular application. This will ensure that the UrlRewriter.Net module from Intelligencia, which was written before IIS7 shipped, will be called and have a chance to re-write all URL requests to the server (including for folders).

What is really cool about the above web.config file is that: 1) It will work on any IIS 7.0 machine. You don't need an administrator to enable anything on the remote host. It will also work in medium trust shared hosting scenarios. 2) Because I've configured the UrlRewriter in both the <httpModules> and IIS7 <modules> section, I can use the same URL Rewriting rules for both the built-in VS web-server as well as on IIS7. Both fully support extension-less URLRewriting. This makes testing and development really easy.

iis 7 - asp.net rewrite url logic works locally but not on server give...

asp.net iis-7 url-rewriting http-status-code-404
Rectangle 27 0

According to this "How do write a rewrite rule in IIS that allows HTML anchors?" answer, browsers do not send anything after the # in a URL request to the server. They're markers intended solely for the browser to scroll to on the resulting page.

If you look at the logs, do you see a full request for the page including the anchor tag?

An alternative might be to use some DOM loaded JS to scroll the page to the anchor referenced in the URL (jQuery required):

$(function () {
  var a_tag = $("a[name='" + window.location.hash.replace("#", "") +']");
  $('html,body').animate({scrollTop: a_tag.offset().top}, 'slow');
});

Although, that likely doesn't solve the intended issue of friendlier URLs.

Thanks for the effort d_ethier, but that's not quite what I'm looking for, but it might have to do :) Yes, the logs show the web server trying to load the file news.html#dd-mmm-yy (which of course doesn't exist). So after much searching I've come to the conclusion that one cannot rewrite to a page anchor (but you can redirect - which doesn't allow the 'friendly' url to remain in-situ). So I think I'll have to solve my issue using traditional params (eg. news.html?d=dd&m=mm&y=yy) and then some jQuery (like you suggest) to convert the params into an on-page anchor and scroll to it.

IIS Rewrite 2.0 Module - 404 errors - Stack Overflow

url-rewrite-module
Rectangle 27 0

I had the same issue when moving a web application from IIS 7 to 8, and I solved it by installing the URL Rewrite Module, which I had completely forgot. So check that you have the correct modules etc. installed on your new server/iis.

iis 8 - IIS 8.0 ASP.NET and Error 500.19 - Stack Overflow

asp.net iis-8
Rectangle 27 0

I experienced a similar issue. I have a URL rewriting class in the APP_Code folder that worked running on Visual Studio 2008 development server and IIS 6.5 but not in IIS 7.5. The "OnBeginRequest" appeared not to fire and I was receiving the same 404 error. After quite a bit of trial and error I found the combination which solved my issue:

In IIS 7.5 under the website basic settings, changed the application pool setting to "Classic .NET AppPool".

In Web.config, I added the following to reference the URL Rewriting class:

<httpModules>
     <add name="*URLRewriteClassName*" type="*Namespace.URLRewriteClassName*"/>
  </httpModules>

Since you are executing your rewrite code from the Global Application Class I would try changing the application pool first and see what happens. Hopefully this helps and good luck!

iis 7 - ASP.NET Context RewritePath 404 Error - Stack Overflow

asp.net iis-7 url-rewriting url-routing http-status-code-404
Rectangle 27 0

By default Joomla uses query string parameters for all the links URLs it generates for your web site. This behavior can be changed by enabling what is called "Search Engine Friendly URLs" in Joomla. However, this feature relies on the URL rewriting functionality to be available on the web server. IIS 6.0 does not have URL rewriting capabilities, so you could use one of the third party URL rewriting products, such as ISAPI_Rewrite or Ionics ISAPI Rewrite Filter. IIS 7.0 has URL rewriting support, which can be enabled by installing Microsoft URL Rewrite Module for IIS 7.0. The following instructions describe how URL Rewrite Module for IIS 7.0 can be used to enable Clean URLs in Joomla. First, you will need to download and install Microsoft URL Rewrite Module. Once it has been installed, create and open a web.config file located in C:\inetpub\wwwroot\Joomla folder. Paste the following XML code into this file.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Security Rule" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
          <conditions logicalGrouping="MatchAny">
            <add input="{QUERY_STRING}" pattern="mosConfig_[a-zA-Z_]{1,21}(=|\%3D)" ignoreCase="false" />
            <add input="{QUERY_STRING}" pattern="base64_encode.*\(.*\)" ignoreCase="false" />
            <add input="{QUERY_STRING}" pattern="(\&lt;|%3C).*script.*(\>|%3E)" />
            <add input="{QUERY_STRING}" pattern="GLOBALS(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" />
            <add input="{QUERY_STRING}" pattern="_REQUEST(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" />
          </conditions>
          <action type="CustomResponse" url="index.php" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
        </rule>
        <rule name="SEO Rule">
          <match url="(.*)" ignoreCase="false" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" pattern="" ignoreCase="false" />
            <add input="{URL}" negate="true" pattern="^/index.php" ignoreCase="false" />
            <add input="{URL}" pattern="(/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$" />
          </conditions>
          <action type="Rewrite" url="index.php" />
        </rule>
      </rules>
    </rewrite>
 </system.webServer>
</configuration>

Save the web.config file and then open web browser and logon to the Joomla administrator console at http://localhost/joomla/administrator/ . Once logged on, go to Site --> Global Configuration menu configure SEO settings as below:

Thanks for the answer. However, I've already followed similar instructions on both my local machine and on the hosted site; it's working on my local machine but not the hosted site... So I need a bit more details on how to diagnose this on the hosted site.

iis - Joomla Search Engine Friendly URLs issue on IIS7 - Stack Overflo...

iis iis-7 seo joomla friendly-url
Rectangle 27 0

When setting server variables using the URL rewrite module of IIS you have to explicitly specify which server variables you allow to be set. This might be necessary for your own code as well. See: http://learn.iis.net/page.aspx/686/setting-http-request-headers-and-iis-server-variables/ (and search for 'Allowing server variables to be changed')

iis 7 - Set a ServerVariable in a IIS 7.0 httpmodule - Stack Overflow

iis iis-7 iis-7.5 httpmodule server-variables
Rectangle 27 0

There are a couple of things that could be happening but is hard to know. Are you sure both URLs are running in the Same Application Pool? That could be one reason why redirect works but not rewrite.

iis 7 - "Rewrite Action" 404 Server Error! (IIS 7.0 MS URL Re-Write Mo...

mod-rewrite iis-7 url-rewriting http-status-code-404