我正在尝试将我的项目从apache2.2迁移到apache2 + hhvm,并使用apache作为反向代理。
在迁移之前,我使用了这个apache配置(以创建漂亮的urls ):
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(server-status)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)$ index.php/$1 [L]所以门户网站网址是这样的:examples.com/post/post as-slug
现在我有了apache的配置:
<IfModule mod_fastcgi.c>
<FilesMatch \.php$>
SetHandler hhvm-php-extension
</FilesMatch>
<FilesMatch \.hh$>
SetHandler hhvm-hack-extension
</FilesMatch>
Alias /ec /ec
Action hhvm-php-extension /ec virtual
Action hhvm-hack-extension /ec virtual
FastCgiExternalServer /ec -host 127.0.0.1:9000 -pass-header Authorization -idle-timeout 300
</IfModule>这个hhvm配置( server.ini ):
hhvm.server.port = 9000
hhvm.server.type = fastcgi
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = /var/log/hhvm/error.log
hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc
hhvm.server.source_root = /w3/dr/只有当我设置url为: examples.com/index.php/post/post-title-as-slug,但如果url类似于:examples.com/post/post as-slug时,此配置才能工作,我收到一个404 http错误。
我想从url中删除index.php。
有人知道解决办法吗?
谢谢。
发布于 2015-04-02 08:37:05
根据hhvm.server.fix_path_info = true,如果您使用的是mod_rewrite规则,则必须在hhvm配置中设置。
https://stackoverflow.com/questions/27334376
复制相似问题