我试图在旧的Wordpress网站旁边添加一个服务器NodeJS实例的路由。 问题是,我想在同一台服务器上运行Wordpress和Node.js,但在不同的路由上运行。.htaccess Wordpress和NodeJS一起运行
WordPress是运行在这里http://example.com
节点在这里运行http://example.com:61000/oferta-de-pret-traduceri
.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^/oferta-de-pret-traduceri$ http://127.0.0.1:61000/ [P,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/oferta-de-pret-traduceri/(.*)$ http://127.0.0.1:61000/$1 [P,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
我不知道WordPress的那么好也不知道的.htaccess像我应该在这种情况下,除非必须,否则我不想将所有内容移至NGINX。
我想让我的Node.js实例在http://example.com/oferta-de-pret-traducerii
上运行,而不是在http://example.com:61000
上运行。
而且WordPress的trows一个404错误,如果我试图访问http://example.com/oferta-de-pret-traduceri
希望有人遇到这种情况,有一个简单的解决方案。
非常感谢您提前!
您提到nginx,但mod_rewrite来自Apache。你实际使用哪个网络服务器? –
我想把所有的东西从Apache移到Nginx,因为这是我知道如何同时运行Wordpress和Node的唯一方法。目前的配置是.htaccess,所以它是Apache ... –