0

My app root: /public/index.php /public/front/index.html

I want to mydomain.com/api to serve from /public/index.php, and my frontend i.e the static site mydomain.com/ from /public/front/index.html.

I have tried using proxy and location with document root as /public/ but failed to deliver the results in Apache2.

Need a correct way around. (Already using a simple conf for nginx to do the same)

Milind Singh
  • 153
  • 7

1 Answers1

1

You typically use the Alias directive to map specific URL paths to locations on your file system, regardless of their locations relative to the designated DocumentRoot.

DocumentRoot /public/front
Alias /api/   /public/ 

Please note that doing the above will also expose your front end on http://example.com/api/front/ but such is the unfortunate result of the odd directory layout that you have chosen...

HBruijn
  • 77,029
  • 24
  • 135
  • 201