Php apachehtaccess重写到HHVM
我希望HipHop虚拟机只为一个特定网站运行php代码。所有其他网站和图片仍将由Apache提供服务。我已经安装了HHVM,它在端口88上运行Php apachehtaccess重写到HHVM,php,apache,.htaccess,mod-rewrite,hhvm,Php,Apache,.htaccess,Mod Rewrite,Hhvm,我希望HipHop虚拟机只为一个特定网站运行php代码。所有其他网站和图片仍将由Apache提供服务。我已经安装了HHVM,它在端口88上运行 我想我需要在该网站的.htaccess中添加一个重写规则,以将对.php文件的请求重定向到端口88。这是正确的解决方案吗?如果是这样的话,我应该添加什么?您可能希望使用反向代理。如果您有权访问vhost/server配置文件,则可以添加如下行: ProxyPassMatch ^/(.*)\.php$ http://127.0.0.1:88/$1.php
我想我需要在该网站的.htaccess中添加一个重写规则,以将对.php文件的请求重定向到端口88。这是正确的解决方案吗?如果是这样的话,我应该添加什么?您可能希望使用反向代理。如果您有权访问vhost/server配置文件,则可以添加如下行:
ProxyPassMatch ^/(.*)\.php$ http://127.0.0.1:88/$1.php
ProxyPassReverse / http://127.0.0.1:88/
或者,如果已打开mod_proxy,则可以在htaccess文件中使用p
标志执行此操作:
RewriteRule ^(.*)\.php$ http://127.0.0.1:88/$1.php [L,P]
ProxyPassReverse / http://127.0.0.1:88/
您可能想要反转代理。如果您有权访问vhost/server配置文件,则可以添加如下行:
ProxyPassMatch ^/(.*)\.php$ http://127.0.0.1:88/$1.php
ProxyPassReverse / http://127.0.0.1:88/
或者,如果已打开mod_proxy,则可以在htaccess文件中使用p
标志执行此操作:
RewriteRule ^(.*)\.php$ http://127.0.0.1:88/$1.php [L,P]
ProxyPassReverse / http://127.0.0.1:88/
我通过将sourceroot设置为特定网站找到了一个解决方案,该网站基于SLIM/PHP框架。它碰巧没有提供图像,所以不需要对其进行过滤。以下是HHVM的配置:
Server {
Port = 88
SourceRoot = /var/www/<specific-folder>
DefaultDocument = index.php
}
VirtualHost {
www {
Pattern = .*
ServerVariables {
PHP_SELF = /index.php
SCRIPT_NAME = /index.php
}
RewriteRules {
index {
pattern = ^(.*)$
to = index.php/$1
qsa = true
}
}
}
}
服务器{
端口=88
SourceRoot=/var/www/
DefaultDocument=index.php
}
虚拟主机{
万维网{
模式=*
服务器变量{
PHP_SELF=/index.PHP
SCRIPT_NAME=/index.php
}
重写规则{
索引{
模式=^(.*)$
to=index.php/$1
qsa=true
}
}
}
}
我找到了一个解决方案,将sourceroot设置为特定的网站,该网站基于SLIM/PHP框架。它碰巧没有提供图像,所以不需要对其进行过滤。以下是HHVM的配置:
Server {
Port = 88
SourceRoot = /var/www/<specific-folder>
DefaultDocument = index.php
}
VirtualHost {
www {
Pattern = .*
ServerVariables {
PHP_SELF = /index.php
SCRIPT_NAME = /index.php
}
RewriteRules {
index {
pattern = ^(.*)$
to = index.php/$1
qsa = true
}
}
}
}
服务器{
端口=88
SourceRoot=/var/www/
DefaultDocument=index.php
}
虚拟主机{
万维网{
模式=*
服务器变量{
PHP_SELF=/index.PHP
SCRIPT_NAME=/index.php
}
重写规则{
索引{
模式=^(.*)$
to=index.php/$1
qsa=true
}
}
}
}