【发布时间】:2015-02-04 17:08:45
【问题描述】:
我正在尝试将我的项目从 apache2.2 迁移到 apache2 + hhvm,并使用 apache 作为反向代理。
在迁移之前,我有这个 apache 配置(制作漂亮的 url):
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(server-status)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)$ index.php/$1 [L]
所以门户网址就像:examples.com/post/post-title-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-title-as-slug i收到 404 http 错误。
我想从 url 中删除 index.php。
有人知道解决办法吗?
谢谢。
【问题讨论】: