bramus / router

A lightweight and simple object oriented PHP Router
MIT License
1.09k stars 245 forks source link

router in subfolder #207

Closed falco1970 closed 1 year ago

falco1970 commented 1 year ago

how this works when there is a redirect to a subfolder?

uvulpos commented 1 year ago

You can configure apache or nginx to redirect every request, that cannot find a file gets routed to your router file where the bramus router can then read the requested url string and answer you with the right controller method

this is an example, how to use it with laravel (same concept)

<VirtualHost *:80>
    ServerAdmin admin@example.com
    ServerName mydomain.com
    DocumentRoot /var/www/html/laravel/public

    <Directory /var/www/html/laravel>
    Options Indexes MultiViews
    AllowOverride None
    Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
uvulpos commented 1 year ago

Closed due to no response, if you need further support, please open a new ticket :)