I would like to set up multiple redirects using apache but am completely stumped as to how to do it?
I have a nodejs instance which serves up my home page running on my server on port 4000. It can be accessed from the server at localhost:4000 (port 4000 is not open to external access).
I have a blog that is a wordpress instance.
The blog resides at mysite.com/blog
So. I would like all requests to mysite.com/blog/xxxxx to be redirected to the wordpress instance, and all other requests (e.g. mysite.com/xxxx/yyyy) to be redirected to my node instance at http://localhost:4000/xxxxx/yyyy
My config file looks like this
9 <VirtualHost *:80> 10 11 # Admin email, Server Name (domain name) and any aliases 12 ServerAdmin xxxxx 13 ServerName xxxxx 14 ServerAlias xxxxx 15 16 17 # Index file and Document Root (where the public files are located) 18 DirectoryIndex index.html index.php 19 DocumentRoot /xxx/xxx/public_html/xxx/public .....
26 <Location /> ?? What goes here? 31 </Location> ......
33 <Location /blog> 34 RewriteEngine On 35 RewriteBase /blog/ 36 RewriteRule ^index\.php$ - [L] 37 RewriteCond %{REQUEST_FILENAME} !-f 38 RewriteCond %{REQUEST_FILENAME} !-d 39 RewriteRule . /blog/index.php [L] 40 </Location> I have tried setting up rewrite rules and proxies but either the blog doesnt work, or the home page does not work.