简体   繁体   中英

Use .htaccess to setup Node.js with lamp environment

I have a subdomain like abc.example.com which run wordpress. And its htaccess has this

# 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

How do I make my root domain which is example.com to not use wordpress / php at all? because example.com is my suppose to be running my node.js app.

I've tried to replace line 2 with

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

Is Node installed on your server? Does your host support using 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.

If they do not, consider a hosting solution that supports Node, like Heroku or Digital Ocean.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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