【发布时间】:2013-01-07 16:56:40
【问题描述】:
mod_rewrite 的新功能。我只是想做这样的事情:
# Turn on the rewriting engine
RewriteEngine On
# use item php page to show the item
RewriteRule ^parts/./[.]$ parts/item.php?id=$1 [NC]
所以当一个人输入 example.com/parts/anything/anything 时,URL 将转到
example.com/parts/item.php?id=the2ndanything
据我了解,句号表示任何字符。另外,我尝试在句号之后添加一个 + (这应该意味着任何东西),但这仍然不起作用。
顺便说一句,我在一个临时 URL 上,因为我还没有更改我以前的网络主机,因此我的实际完整 URL 中有一个 ~。我希望这不是 mod_rewriting 的问题,因此是阻止它工作的问题。 .htaccess 文件位于网站 index.html 的根文件夹中。
【问题讨论】:
标签: php html apache .htaccess mod-rewrite