Hi guys! I’ve already uploaded my symfony app via FTP in the subdirectory in htdocs directory. My problem is how I can access to my web app. I tried to access it via mydomain/project_dir but I always have an error. Could someone help me?
The error suggests that Symfony is loaded, but it doesn’t have any routes configured for the given URL. Do you have a route set up for that URL in your site’s Symfony configuration?
I think the issue is caused by your .htaccess setup.
I see you tried to make the public folder thing work by setting a DirectoryIndex in the .htaccess file in the htdocs folder. The project folder and the public folder themselves don’t have any .htaccess files.
The consequence is that /orange-debit-suivi/ will be routed to /orange-debit-suivi/public/index.php, which is OK, but /orange-debit-suivi/admin/ will be routed to /orange-debit-suivi/admin/public/index.php, which is not OK of course.
If you can make it work, good for you, but I would like to suggest a different route:
Delete the .htaccess file in the htdocs directory. You don’t need it for your sub-project.
Restore the original Symfony .htaccess file in the public folder. It contains configuration necessary for Symonfy to work.
Create a new .htaccess file in the /orange-debit-suivi/ folder with this code: .htaccess for Laravel
Thanks for your response .
When I follow your suggestion , I have an 404 error. I don’t see what you mean about the .htaccess in public directory for symfony
Laravel and symfony are a little bit similar , I try it like laravel deployement but It doesn’t work for me
A default Symfony installation should have a .htaccess file in the public directory. I cannot find the official source for it, but this is one such file found in the official demo code: demo/public/.htaccess at main · symfony/demo · GitHub
This file is necessary to route any sub-URLs (like /admin) to the main index.php. Your site doesn’t have this file, so any URLs other than the home URL will not work.
Please restore the original Symfony .htaccess in the public directory in addition to the Laravel snippet in the project’s root directory.