Bhaskar Rajoriya Bhaskar Rajoriya - 1 year ago 72
Apache Configuration Question

How to config multi projects with single domain?

I am too new in server technology. I have some problem with configuration of multi projects with each different framework in single domain.

The scenario is, i have a folder structure like below




I need to setup these projects with single domain with conditions are :

1 if user access then need to run project-angular/dist/index.html

2 if user access*) then need to run project-wordpress/index.php

3 if user access*) then need to run project-aurelia/index.html

I am trying this experiment on my local so i have access of each files.

Please suggest how i can achieve this. I have tried with .htaccess but it is like foreign language for me.

Edit :

I don't want to redirect users to another domain. I just want that if access the then according to above description folder code should run.


Answer Source

I found a solution for this problem. And now sharing with you all which I did. Please check and let me know if you have any Queries. Create Alias.

1 Set with Aurelia project directory. Because apart from / and /blog we need all other URL from Aurelia. (Solution of Point 3)

2 Create an Alias for Blog section as /blog. And set the*) with WordPress project directory. (Solution of Point 2).

3 For URL / create the other Alias for example /home and set the with Angular project directory. And keep the Angular project in Aurelia Root directory.

Redirect the user to Angular base URL whenever user will access

Add below code in the httpd-vhosts.conf file.

<Directory "path-to-aurelia/project-aurelia/">
    DirectoryIndex project-angular/dist/index.html
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Require all granted

Now All the Angular links will run on*). (Solution of Point 1)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download