我想自动将未找到的每个页面指向另一个页面 [英] I want to auto direct every page not found to another page

查看:65
本文介绍了我想自动将未找到的每个页面指向另一个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我的网页代码如下: -



Hi,

I've following page code:-

<li><a href="perloan.aspx">Personel Loans</a></li>
                    <li><a href="homloan.aspx">Home Loans</a></li>
                    <li><a href="lap.aspx">Loan Against Property</a></li>
                    <li><a href="autloan.aspx">Vehicle Loans</a></li>
                    <li><a href="">Education Loans</a></li>
                    <li><a href="">Business Loans</a></li>
                    <li><a href="">Loan Against Gold</a></li>
                    <li><a href="">Expert Advice</a></li>







现在我想要每个空(一个href)链接标记。它应该被重定向到fd.aspx页面。

我在web.config中尝试了以下代码: -






Now I want for every empty (a href) link tag. It should be redirected to fd.aspx page.
I tried the following code in web.config:-

<configuration>
  <system.webServer>
    <httpRedirect enabled="true" destination="www.paisamarket.com/fd.aspx" exactDestination="true" httpResponseStatus="Permanent" />
  </system.webServer>
  <location path="fd.aspx">
    <system.webServer>
      <httpRedirect enabled="true" />
    </system.webServer>
  </location>
    <appSettings>
        <add key="str" value="data source=DEEPAKSHARMA-PC\SQLEXPRESS; initial catalog=new; integrated security=true"></add>
    </appSettings>
</configuration>







但它没有用。请帮帮我..........




But it's not working. Please help me..........

推荐答案





目前你正在重新指向fd.aspx目标路径,如果检查fd.aspx。





如果找不到页面错误重定向,请试试这个。



Hi,

currently you are re-directing to fd.aspx destination path if being checked for fd.aspx.


For page not found error redirection, try this.

<customErrors mode="RemoteOnly" defaultRedirect="~/GeneralError.aspx">
     <error statusCode="404" redirect="~/PageNotFound.aspx"/>
   </customErrors>







其他所有e rrors,它重定向到一般错误页面。

对于404错误,它会重定向到pagenotfound.aspx页面。



希望这会有所帮助。 />


快乐编码!




For all other errors, it redirects to general error page.
For 404 error it redirects to pagenotfound.aspx page.

hope this helps.

Happy coding!


这篇关于我想自动将未找到的每个页面指向另一个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆