帮助简单的RewriteRule

时间:2011-02-28 03:37:03

标签: php apache

我正在尝试使用简单的htaccess规则来获得整洁的URL,如此。

http://domain.com/theid => read by http://domain.com/read.php?id=theid

但仍有其他网址,例如http://domain.com正常阅读

在玩完之后,我最终得到了这个(不工作):

RewriteRule ^domain.com\/(.){5}$ read.php?id=$1 [QSA,L]

1 个答案:

答案 0 :(得分:1)

Rewriterules不应包含域,因此您需要编写类似:

的内容
RewriteRule ^/(.{5})$ /read.php?id=$1 [QSA,L]
相关问题