在重写中将 web.config 转换为 .htaccess 时出错
我正在迁移服务器,它都是 php 但它在 Windows 服务器上(不知道为什么,但它就是这样:P)
<rule name="category2" stopProcessing="true">
<match url="^categoryi/([0-9]+)/([0-9]+)/([a-zA-Z0-9_ -]+)" ignoreCase="false" />
<action type="Rewrite" url="listbycategory.php?id={R:1}&pagenumber={R:2}" />" />
</rule>
我尝试过:
Options Indexes FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^categoryi/([0-9]+)/([0-9]+)/([a-zA-Z0-9_ -]+)/?$ listbycategory.php?id=$1&nroPagina=$2
但是世界爆炸了,关于我的任何线索搞乱?
I'm migrating a server, it was all php but it was on a windows server (don't know why, but it is what it is :P)
<rule name="category2" stopProcessing="true">
<match url="^categoryi/([0-9]+)/([0-9]+)/([a-zA-Z0-9_ -]+)" ignoreCase="false" />
<action type="Rewrite" url="listbycategory.php?id={R:1}&pagenumber={R:2}" />" />
</rule>
I tried with:
Options Indexes FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^categoryi/([0-9]+)/([0-9]+)/([a-zA-Z0-9_ -]+)/?$ listbycategory.php?id=$1&nroPagina=$2
But the world explodes, any clues on what i'm making a mess?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该转义重写规则中的空格,因此将重写规则行更改为:
注意空格之前的 \。
顺便问一下,您是故意将 pagenumber 变量更改为 nroPagina 吗?
You should escape the space in your rewrite rule, so change your rewrite rule line into:
Note the \ before the space.
By the way, is it on purpose that you changed the pagenumber variable into nroPagina?