Difference between revisions of "Extension less URLs and custom error pages"

From AbleCommerce Wiki
Jump to: navigation, search
(New page: If you are using extensionless URLs for your products or webpages you may notice that custom 404 error page may not be working for a missing extension less URL. In order make custom error ...)
 
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
 
     <system.webServer>
 
     <system.webServer>
 
   </pre>
 
   </pre>
* Add following configurations  
+
* Add following configurations under system.webServer element
 
   <pre>
 
   <pre>
 
     <httpErrors errorMode="Custom">
 
     <httpErrors errorMode="Custom">
Line 12: Line 12:
 
       <error statusCode="404" subStatusCode="-1" path="/Errors/PageNotFound.aspx" responseMode="ExecuteURL" />
 
       <error statusCode="404" subStatusCode="-1" path="/Errors/PageNotFound.aspx" responseMode="ExecuteURL" />
 
     </httpErrors>
 
     </httpErrors>
 +
  </pre>
 +
* If your install is running under Virtual Directory/Application for example yourstore.com/shop then make sure you have path prefixed with Virtual Directory/Application name. For example for /shop it should look like following
 +
 
   <pre>
 
   <pre>
 +
    <httpErrors errorMode="Custom">
 +
      <remove statusCode="404" subStatusCode="-1" />
 +
      <error statusCode="404" subStatusCode="-1" path="Shop/Errors/PageNotFound.aspx" responseMode="ExecuteURL" />
 +
    </httpErrors>
 +
  </pre>
 +
* Save web.config file and now custom 404 error page should appear for missing extension less URLs.

Latest revision as of 06:50, 24 August 2016

If you are using extensionless URLs for your products or webpages you may notice that custom 404 error page may not be working for a missing extension less URL. In order make custom error pages work with extension less URLs in gold you will have add an extra piece of configuration. Following is a step by step guide about enabling custom error pages while using extension less URLs.

  • Edit your Website/web.config file
  • Locate following element
    <system.webServer>
  
  • Add following configurations under system.webServer element
    <httpErrors errorMode="Custom">
      <remove statusCode="404" subStatusCode="-1" />
      <error statusCode="404" subStatusCode="-1" path="/Errors/PageNotFound.aspx" responseMode="ExecuteURL" />
    </httpErrors>
  
  • If your install is running under Virtual Directory/Application for example yourstore.com/shop then make sure you have path prefixed with Virtual Directory/Application name. For example for /shop it should look like following
    <httpErrors errorMode="Custom">
      <remove statusCode="404" subStatusCode="-1" />
      <error statusCode="404" subStatusCode="-1" path="Shop/Errors/PageNotFound.aspx" responseMode="ExecuteURL" />
    </httpErrors>
  
  • Save web.config file and now custom 404 error page should appear for missing extension less URLs.