2

I am too new in server technology. I have some problem with configuration of multi frameworks in single domain.

The scenario is, i have a folder structure like below

/web
        /project-angular
            /dist/index.html

        /project-aurelia
            /index.html

        /project-wordpress
            /index.php

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

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

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

3 if  user access domain.com/(*) 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 domain.com then according to above description folder code should run.

Thanks.

Brn.Rajoriya
  • 1,534
  • 2
  • 23
  • 35
  • Possible duplicate of [Htaccess redirect all files from subdirectory in one domain to another domain](https://stackoverflow.com/questions/16864690/htaccess-redirect-all-files-from-subdirectory-in-one-domain-to-another-domain) – Juliën Jun 01 '17 at 21:12
  • No @Moriarty , Suggested discussion is related to two domains. Here i need to run 3 different frameworks with single domain. – Brn.Rajoriya Jun 02 '17 at 06:54
  • May be possible through sub domain – Butani Vijay Jun 02 '17 at 07:09
  • Yes @ButaniVijay, This can be possible by sub-domain. But that is the option we go most of the time. If there is option as i want then that would be great and would be new learning for me. Thanks – Brn.Rajoriya Jun 02 '17 at 07:13

1 Answers1

2

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 domain.com 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 domain.com/blog/(*) with WordPress project directory. (Solution of Point 2).

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

Redirect the user to Angular base URL whenever user will access domain.com

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
</Directory>

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

Brn.Rajoriya
  • 1,534
  • 2
  • 23
  • 35