URL重写或清理URL [英] URL Rewriting or Clean URL

查看:88
本文介绍了URL重写或清理URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误页面:

http://lovejaygore.com/g-info-tech-7 [

error page :

http://lovejaygore.com/g-info-tech-7[^]

Please suggest me required changes in web.config file.

Web.config File

<?xml version="1.0" ?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
  <configSections>
    <section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>
  </configSections>
  <appSettings/>
  <connectionStrings>
    <add name="sqlcn" connectionString="Data Source=204.93.174.60;database=lovejayg_DBannualReport;uid=lovejayg_sa;Pwd=143chitchor"/>
  </connectionStrings>
  <system.web>
    <customErrors mode="Off" redirectMode="ResponseRewrite"/>
    <httpModules>
      <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter"/>
    </httpModules>
    <!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->

    <!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
    <authentication mode="Windows"/>
    <!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
 
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->

  </system.web>
  <rewriter>
    <rewrite url="~/Article/(.+)-(.+).aspx" to="~/DynamicPage.aspx?MyTitleId=$2"/>
  </rewriter>
</configuration>

推荐答案

2" > < /rewriter > < /configuration >
2"/> </rewriter> </configuration>


该页面是404错误,表示未找到所请求的页面.检查您的URL重写实现.如果您共享没有任何信息的web.config,没有人能修复您的代码.

在这里阅读:
使用ASP.NET进行URL重写 [ MSDN:URL重写 [
That page is a 404 error which means the page requested was not found. Check your URL rewriting implementation. No one can just fix your code if you share your web.config without any information around it.

Read here:
URL Rewriting with ASP.NET[^]
MSDN: URL Rewriting[^]


这篇关于URL重写或清理URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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