URL重写规则不工作 [英] URL Re-Write Rule Not Working

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

问题描述

我试图重写URL结尾一样(不仅完全等于)这样的:

I am trying to rewrite URLs ending like (not only exactly equal to) this:

评论/ - 最新-Out的巴基斯坦/ 68

comments/The-Latest-Out-of-Pakistan/68

到这个结尾的网址:

评论/的index.php?submissionid = 68

comments/index.php?submissionid=68

下面是我的.htaccess文件,但它不工作。

Below is what I have in the .htaccess file, but it's not working.

RewriteEngine On
RewriteRule ^comments/([A-Za-z0-9-]+)/([0-9]+)?$ comments/index.php?submissionid=$2 [NC,L]

任何想法,为什么它不工作?

Any idea why it's not working?

在此先感谢,

约翰·

推荐答案

我测试了它,这一件作品:

I tested it and this one works:

RewriteEngine On
RewriteRule ^comments/([a-zA-Z0-9-]+)/([0-9]+)?$ comments/index.php?id=$2 [NC,L]

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

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