Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: ColdFusion 10, IIS 7.5, and custom 404 page

$
0
0

Hi

 

For 404.cfm to display when access a non -exisiting .cfm and .html, you need to place the 404.cfm in both ColdFusion webroot (wwwroot) and your website's webroot.

 

Your web.config should look like this

 

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

    <system.webServer>

        <httpErrors errorMode="Custom">

            <remove statusCode="404" subStatusCode="-1" />

            <error statusCode="404" prefixLanguageFilePath="" path="/404.cfm" responseMode="ExecuteURL" />

        </httpErrors>

    </system.webServer>

</configuration>

 

 

Now when you access a non exisiting .html say http://www.adobe.com/hello.html then URL should redirect to http://www.adobe.com/404.cfm, below are the steps to follow.

 

If you want to do the same for site level, then go to error pages in IIS for your site

 

IIS2.jpg

 

Choose Respond with a 302 direct with the 404.cfm URL placed in the webroot of your website

 

IIS.jpg

Hope it helps

 

Thanks

VJ


Viewing all articles
Browse latest Browse all 21760

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>