2014-07-21 36 views
-1

我的URL重写工作,但它返回空记录......URL重写工作,但空的记录

example.co.uk/pressnote/index?q=4

回:example.co。英国/新闻/索引/问题/ 4.html

它的工作,但doest返回我的记录集数据,如example.co.uk/pressnote/index?q=4确实返回我的数据。

my .htaccess: 
RewriteEngine on 
RewriteRule ^index/questions/([0-9]+?)\.html$ index.php?q=$4 
+0

你是什么意思?它不显示你的页面? – Darren

+0

有更多规则吗?这是你使用的一些PHP/CMS框架吗? – anubhava

+0

它显示我的页面,但没有显示上述查询字符串参数的内容 – PULabs

回答

0

我简单地改变$4应该$1

RewriteEngine on 
RewriteRule ^index/questions/([0-9]+?)\.html$ index.php?q=$1 
+0

如果只有两个在您的正则表达式中捕获组,例如example.org/b2b/post?post_id=1&post_subject=test以:example.org/b2b/post/1/test – PULabs