Jednoduchý URL rewriting

Jednoduchý způsob, jak používat přepisování URL, aniž by bylo cokoliv naprogramované. Stačí nastavit v souboru Web.config sekce urlMapping

<configuration>
  <system.web>
    <urlMappings enabled="true">
      <add url="~/Web/FirstArticle.aspx" mappedUrl="~/Web/Page.aspx?id=1" />
      <add url="~/Web/SecondArticle.aspx" mappedUrl="~/Web/Page.aspx?id=2" />
      <add url="~/Web/ThirdArticle.aspx" mappedUrl="~/Web/Page.aspx?id=3" />
    </urlMappings>
  </system.web>
</configuration>

Jaký pool spouští w3wp.exe proces

Pokud potřebuji zjistit, který w3wp.exe proces byl spuštěn, kterým aplikačním poolem na IIS7, lze to zjistit z příkazové řádky.

%windir%/system32/inetsrv/appcmd list wp
 
C:\Windows\system32/inetsrv/appcmd list wp

Výsledke se vypíše např. takto

WP “5716” (applicationPool:DefaultAppPool)
WP “968” (applicationPool:MyOtherAppPool)
WP “5836” (applicationPool:TheThirdAppPool)

Více informací např. zde.

Status kódy

Zde je seznam stavových kódů vrácených z webového serveru IIS

CategoriesRange of status codesDescription
Information 100 - 199 Messages defined by specific applications.
Success 200 - 299 The request was successfully processed.
Redirecting 300 - 399 The client has the final processing of requests to perform an activity. Of this activity, the user may not know.
Client Error 400 - 499 Problems on the client side.
Server Error 500 - 599 Problems on the server side.

 

Status codeDescription
100 Continue The client may continue to send a request.
101 Switching Protocols Server Protocol.
200 OK The operation went without error, the requirement is successfully met.
201 Created The result is a requirement of the newly created object.
202 Accepted Asynchronous request has been received. The request was properly accepted, the corresponding activity is still to do yet not have.
204 No Content The request was successful, but its results are no data to client.
300 Multiple choises The requested resource can be obtained from several different locations. The response returns a list of all options.
301 Moved Permanently The requested URL has moved permanently to a new URL. All other references must use this new URL.
302 Moved Temporarily The requested URL temporarily moved to a new URL. All other links can use the current URL.
304 Not Modified Contingent claim was processed correctly, but the document from that time has not been modified.
400 Bad Request Server does not understand the request, the client must be repaired and re-send.
401 Unauthorized If the original client request anonymous, must not be authenticated. If you claim has been authenticated, then access is denied.
403 Forbidden The server can not meet demand, authorization was successful.
404 Not Found Server could not locate the specified URL.
405 Method Not Allowed The method is not permissible to achieve the desired object.
406 Not Acceptable The requested object is not available in a format supported by client.
408 Request Timeout Client completed sending the request within the time limit.
410 Gone The requested object has been permanently removed.
415 Unsupported Media Type The request contains data in the server unknown format.
500 Internal Server Error The server encountered an unexpected error.
501 Not Implemented This site does not request.
502 Bad Gateway Proxy server or gateway received from another server, an invalid response.
503 Service Unavailable Server is temporarily unable or unwilling to handle the request. Usually when it is overloaded or perform maintenance.
505 HTTP Version Not Supported Server does not support the version of HTTP request.

O blogu

Tento blog je místem, kde sdílím své zkušenosti, části zdrojových kódů, odkazy apod. Zdroje jsou zaměřeny převážně na problematiku portálového řešení SharePoint a vývoj webů v prostředí Microsoft. Mým cílem není úplně obsahnout konkrétní řešení, ale pouze tu část, kterou potřebuji. Pokud se problematika obsáhlejší, jsou pod článkem odkazy na související informace.

O autorovi

Oldřich Zátopek
Zabývám se vývojem webových aplikací internet/intranet na Microsoft technologiích. Hlavní specializace je SharePoint. LinkedIn