Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我想优化我的搜索引擎优化的目的网址。使用Umbraco ASP.NET_Asp.net_Model View Controller_Url Rewriting_Umbraco - Fatal编程技术网

我想优化我的搜索引擎优化的目的网址。使用Umbraco ASP.NET

我想优化我的搜索引擎优化的目的网址。使用Umbraco ASP.NET,asp.net,model-view-controller,url-rewriting,umbraco,Asp.net,Model View Controller,Url Rewriting,Umbraco,这是web.config中的代码,可能对您有所帮助。 我的url:capcom/?page=2 我想从url或“/”中删除“?”。我建议您只需在url中添加一个规范url,而该url上没有查询字符串。这可能看起来像: <rule name="blog categories" stopProcessing="true"> <match url="/?blog/categories/([^/]+)/" /> &l

这是web.config中的代码,可能对您有所帮助。 我的url:capcom/?page=2
我想从url或“/”中删除“?”。

我建议您只需在url中添加一个规范url,而该url上没有查询字符串。这可能看起来像:

<rule name="blog categories" stopProcessing="true">
                <match url="/?blog/categories/([^/]+)/" />
                <action type="Redirect" url="/blog/cat={R:1}" />
            </rule>

要使用类似于…/page/2而不是…?page=2的URL,可以将此规则添加到web.config的“重写”部分:

<link rel="canonical" href="@Model.Current.Url">


请提供几个示例,说明您希望实现哪些重定向。例如:
page/A/url
->
pageB/url
/pk/automotive motorkes/?page=1要将其重定向到哪个url?规范非常有用。但是,我很确定这个基本示例将忽略查询字符串(这可能会影响页面上呈现的内容,例如是否存在分页)。设置正确的规范可能和设置正确的重定向一样困难。你说得对,smarty pants。这是一个简单的例子,但您并不总是希望每个页面都由Google索引,它可以创建两个多索引URL。如果您想将页面也放在其中,则可以使用:
<rule name="pagination" stopProcessing="true">
  <match url="(.+)/page/([0-9]+)$" />
  <action url="{R:1}?page={R:2}" type="Rewrite" />
</rule>