2010-12-09 57 views
0

我有以下URL,我努力在我的域根目录下的.htaccess文件中重写。充其量,我得到一个500服务器错误。.htaccess Mod_Rewrite多个条件

来源:http://sub.example.com/a/?id=1234 要:http://sub.example.com/a/1234

来源:http://sub.example.com/a/b/?id=1234 要:http://sub.example.com/a/1234/b

从我读过这应该是相当简单,但我似乎无法得到任何工作!

+0

到目前为止,在下面是不成功的变化: RewriteEngine叙述在:: 重写规则^一/(.*)/ A/ID = $ 1 [NC] – Buzz 2010-12-09 22:43:39

回答

0

试试这个规则:

RewriteRule ^a/([0-9]+)(/.*)?$ /a$2/?id=$1 [NC]