我目前正在测试 HipHop 虚拟机是否值得一个网络应用程序。以前,我习惯于使用这个 htacess 文件在 LAMP 环境中运行它:
Options +FollowSymLinks
IndexIgnore */*
# Turn on the RewriteEngine
RewriteEngine On
# Rules
RewriteRule ^(Templates|Ressources)($|/) - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
谁能告诉我如何在 hhvm.hdf 文件中配置 VirutalHost 以实现此目的?
最佳答案
您可以尝试组合使用 AllowedDirectories 和 VirtualHost:
AllowedDirectories {
* = Templates
* = Ressources
}
VirtualHost {
* {
Pattern = .*
RewriteRules {
* {
pattern = ^(.*)$
to = index.php$1
qsa = true
}
}
}
}
关于HHVM - 重写单个入口点的规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18965025/