我最近做了一个小网址缩短器。现在我一直在试图找出 mod_rewrite 的正则表达式。这是我所拥有的:(对于 lighttpd)
$HTTP["host"] =~ "mywebsite.com" {
server.document-root = "/var/www/mywebsite.com"
url.rewrite-once = ("^/create.php(.*)" => "/create.php$1",
"^/(.*)" => "/index.php?key=$1")
}
我不确定我做错了什么,这就是我想要做的:
mydomain.com/blahblahblah -> mydomain.com/index.php?key=blahblahblah
除非,它是 mydomain.com/create.php,然后我希望正则表达式忽略它。我怎样才能做到这一点?