Apache mod_重写uri,不带扩展

Apache mod_重写uri,不带扩展,apache,rewrite,mode,Apache,Rewrite,Mode,我需要有关apache url重写的帮助,我希望所有不带扩展名的url都重定向到index.php?id=query\u字符串 http://www.abc.com/abc 应该去http://www.abc.com/index.php?id=abc 对于带有扩展的链接,它不应该干扰 谢谢我不确定这是你要找的,但我来试试: RewriteEngine On RewriteRule ^[!/.]*([A-Za-z]+)/?$ /index.php?id=$1 [NC,L]

我需要有关apache url重写的帮助,我希望所有不带扩展名的url都重定向到index.php?id=query\u字符串

http://www.abc.com/abc 应该去http://www.abc.com/index.php?id=abc

对于带有扩展的链接,它不应该干扰


谢谢

我不确定这是你要找的,但我来试试:

RewriteEngine On
RewriteRule     ^[!/.]*([A-Za-z]+)/?$       /index.php?id=$1    [NC,L]
如果URL不包含“.”字符且仅包含字母,则将其放入“id”请求中,否则将保持不变


希望这能有所帮助。

感谢您的回复,但当任何整数出现在内部时,它都无法工作,无法在3分钟内将[0-9]添加到规则中:D。