简体   繁体   English

使用.htaccess在灯泡环境中设置Node.js

[英]Use .htaccess to setup Node.js with lamp environment

I have a subdomain like abc.example.com which run wordpress. 我有一个像abc.example.com这样的子域,可以运行wordpress。 And its htaccess has this 它的htaccess有这个

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

END WordPress 结束WordPress

How do I make my root domain which is example.com to not use wordpress / php at all? 我如何使我的根域example.com完全不使用wordpress / php? because example.com is my suppose to be running my node.js app. 因为example.com是我想运行的node.js应用程序。

I've tried to replace line 2 with 我试图用替换第二行

RewriteRule / http://localhost:3000/$1 [P,L] but it broke my abc.example.com RewriteRule / http://localhost:3000/$1 [P,L] but it broke my abc.example.com

Is Node installed on your server? 服务器上是否安装了Node? Does your host support using Node? 您的主机支持使用Node吗? Verify that with your hosting, and if they do support Node, ask how you they can help you to configure your instance for use with Node. 验证是否具有托管功能,以及它们是否支持Node,请询问它们如何帮助您配置实例以与Node一起使用。

If they do not, consider a hosting solution that supports Node, like Heroku or Digital Ocean. 如果不支持,请考虑一个支持Node的托管解决方案,例如Heroku或Digital Ocean。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM