3
I have the following problem, I have an application with the following structure:
- app - Folder to store project files as controllers and models.
- public_html - Stores public documents on the web, such as index, uploads, css.
- Routes.php - Manage my project’s routes, called by index.php in the public_html folder
- .htaccess - "the problem"
I need that when a user accesses exemplo.com, request is redirected to my folder public_html, in case the index.php of that folder would be triggered, and would include the routes.php directory at the level above, but do not want the url exemplo.com/public_html/index.php.
Nor would I like it to be possible to access the url directly as exemplo.com/public_html, i.e., to avoid duplicated Urls as exemplo.com/index.php?pagina=1 and exemplo.com/public_html/index.php?pagina=1, wanted that when someone performs direct access to this page, he be redirected to exemplo.com.
Remarks: I use the Apache server in the Debian 8 distribution and want to make these settings through the .htaccess, have the mod_rewrite active and functional.
I didn’t quote any file from public_html, but I believe that maybe I will need settings in the .htaccess from there.
I plan to implement friendly Urls as well.
Could someone help me solve this problem?
Ps: This does not solve the problem with friendly Urls, only solves the access to public_html folder.
– Ana P. Messina