Run Node and Wordpress site with a Single Domain in Apache Use Following Command.
- Already site running with Node Project in Apache (localhost.com)
- Need to run Wordpress website as well as on apache with /blog path (localhost.com/blog)
Step 1 : Create /blog directory under html
Step 2 : Run wordpress website Via .htaccess file.
syntax for .htaccess :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
virtual host syntax :
- Note : Below are the syntax for WordPress with /blog path and node with Port Number
- Add below syntax in node.conf file
ServerName localhost.com/
ServerAdmin webmaster@localhost
#DocumentRoot /var/www/html/
Alias /blog /var/www/html/blog
<Directory /var/www/html/blog>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ProxyPassMatch ^/blog !
ProxyPass / http://localhost:9696/
ProxyPassReverse / http://localhost:9696/
No comments:
Post a Comment
testing