1

I have been following this http://zendframework.github.io/zend-expressive/cookbook/using-a-base-path/

I have application under directory structure like this

/(root)
  -webApp
    - (other directory)
    -public

Following above guide works if i use subdomain pointing toward webApp. But it does not work if i follow directory structure.

http://webapp.example.com - works if it points to webApp

http://example.com/webApp - It does show 404 error (route cant find anything in zend expressive)

I can not use subdomain here. so it must be the second way which i need to done.

EDIT:

I have tried with this htaccess. it is in application root (/webApp/.htaccess). It seems like this htaccess is not matching and not routing the request to public directory.

RewriteEngine On
RewriteRule webApp/(.*) ./public/$1
varuog
  • 3,031
  • 5
  • 28
  • 56
  • Hi! Have you tried any solution from this cookbook? https://github.com/zendframework/zend-expressive/blob/master/doc/book/cookbook/using-a-base-path.md – Thomas Dutrion Apr 07 '17 at 07:33
  • @ThomasDutrion It's the same page. – xtreamwayz Apr 07 '17 at 12:38
  • @varuog What exactly did you do? If you say that you exactly followed that guide, what did you follow (as it gives different solutions) and what changes did you make? Need some code to be able to give some feedback. – xtreamwayz Apr 07 '17 at 12:44
  • @xtreamwayz please check the update – varuog Apr 10 '17 at 03:56
  • @ThomasDutrionv please check the update – varuog Apr 10 '17 at 03:57
  • I'm pretty sure the documentation says: `RewriteRule (.*) ./public/$1 ` – xtreamwayz Apr 10 '17 at 06:38
  • @xtreamwayz yes but that does not work either. It does shows 404 error page. It turns out that if `RewriteRule (.*) ./public/$1` is used. router got its path like `webApp/some/path` which does not got match and it supposed to be only `some/path`. So itried to rewrite the .htaccess so webApp get removed from the path. but that did not work. – varuog Apr 10 '17 at 07:18
  • Which 404 error page does it show? From expressive or Apache? – xtreamwayz Apr 10 '17 at 09:14
  • @xtreamwayz from expressive – varuog Apr 10 '17 at 09:48
  • So that means that the apache server setup is working. The configuration inside expressive doesn't seem to work. Did you use los/basepath or mtymek/blast-base-url? And can you share that config? – xtreamwayz Apr 10 '17 at 09:56

0 Answers0