Note that there are some explanatory texts on larger screens.

plurals
  1. POServiceStack web.config settings ignored when using custom path
    primarykey
    data
    text
    <h2>Introduction</h2> <p>My ServiceStack service handles route parameters that often contain periods ie: <code>/people/search/b.j./upton</code>. Initially, asp.net/ServiceStack would throw a "404 - Not Found" exception when it encountered this route. I tried encoding <code>%2E</code> the periods with no luck but eventually resolved the issue after seeing some related questions by setting the <code>relaxedUrlToFileSystemMapping</code> property (<a href="http://haacked.com/archive/2010/04/29/allowing-reserved-filenames-in-URLs.aspx" rel="nofollow">info</a>) within my <code>web.config</code>.</p> <h2>Problem</h2> <p>This worked perfectly until today when I had to change my service location from the default path to a custom path by adding <code>&lt;location path="api"&gt;</code> (as described <a href="https://github.com/ServiceStack/ServiceStack/wiki/Run-servicestack-side-by-side-with-another-web-framework" rel="nofollow">here</a>) to my web.config. Since adding the location node in web.config the <code>relaxedUrlToFileSystemMapping</code> setting is no longer applied and my routes with periods <code>/api/people/search/b.j./upton</code> are breaking once again resulting in '404 - Not Found' exceptions from ServiceStack.</p> <h2>Setup</h2> <p>ServiceStack - v3.9.56</p> <p>IIS 7.5 / IIS Express (happens on both)</p> <p>web.config:</p> <pre><code> &lt;location path="api"&gt; &lt;system.web&gt; &lt;httpHandlers&gt; &lt;add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" /&gt; &lt;/httpHandlers&gt; &lt;httpRuntime relaxedUrlToFileSystemMapping="true"/&gt; ... &lt;/location&gt; </code></pre> <h2>Question</h2> <p>Anyone have an idea why the <code>relaxedUrlToFileSystemMapping</code> property is ignored when it is moved from the default path to within my custom <code>&lt;location path="api"&gt;</code> in web.config?</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload