-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using different subdirectory #43
Comments
Hi @matteovisotto, |
That's my configuration. At the moment is the default site and the routing system is under test path:
I've noticed that adding location /test/api/ or deleting it the result is the same, a white page (not 404 from the main index) that could be a php script error but the code is the same of the main page (just for a test) and I have changed the include Route class path. EDIT: no problem if you have a solution for Apache htaccess, I translate it :) |
Hi @matteovisotto |
For Apache your example works fine for me. Here is a tree of all included files. In my webroot I have created a "test" folder. Inside this I have created a "api" folder. Both folders and also the root folder have a .htaccess file and an index.php file. In this example I use the router three times in different dirs:
Here are some examples of the different rewrite bases inside the htaccess files:
The basepath inside each index.php will change in a similar way:
Everything works as expected in my Apache example. Hops that helps for now. |
Thanks. I'll try again, also on Apache. (I can't at the moment but I'll let you know) |
Please share your config, if you're faster than me to get this to work on nginx. |
I found the correct Nginx configuration assuming that the index.php file containing the routing instruction is contained in a subfolder called "test" and the "api" folder (with its index.php file) is a subfolder of test. The base location controls all the file in the main directory. It seems to be equals to the previous configuration but I created a new virtual host (maybe an old configuration was the problem)
} |
Perfect! Thank you. I will use this maybe as a basis when creating the nginx docker example. |
Hi, my project has the main folder with index.php file, then I would like to use the api subdirectory with an other index.php in order to manage the different routes with different files. I've tried to create the subdirectory, add an index, change the base path and write my routes. I've also add a location /app/api/ to my Nginx server configuration but it doesn't work, How can I do that? (the main routing system works perfectly)
The text was updated successfully, but these errors were encountered: