2
我试图使用友好的URL是这样的:友好的URL与文件同名
RewriteRule ^index/([1-9]{1,5})$ /index.php?id=$1 [L]
RewriteRule ^contact/([1-9]{1,5})$ /contact.php?id=$1 [L]
但这不是工作,我想这是因为我使用的文件的名称RegEx。
这工作得很好:
RewriteRule ^home/([1-9]{1,5})$ /index.php?id=$1 [L]
RewriteRule ^emailus/([1-9]{1,5})$ /contact.php?id=$1 [L]
我不知道这是不可能的friedly网址使用的文件名,请,有人知道的方式来修改这个配置?在其他情况下,我将不得不更改我的文件的所有名称。
你可以随时打开改写记录,看看发生了什么事情:http://httpd.apache.org/docs/current/mod/mod_rewrite.html#logging水平'trace3'将显示通过规则和重写操作的基本路径,使您能够看到这是不是工作。 –
谢谢,我会试试这个 – Marcelo