I'm following this tutorial and there is this file structure:
└── public
├── .htaccess
└── index.php
└── .htaccess
Everything works as expected.
The root .htaccess looks like this:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
</IfModule>
I don't know much about .htaccess but I suppose this reroutes the URI to public
directory. So every request goes there.
The .htaccess from public directory looks like this:
<IfModule mod_rewrite.c>
Options -Multiviews
RewriteEngine On
RewriteBase /auth/public
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
</IfModule>
Everything above works as expected but I want to enhance it so it works like this:
- URL
https://www.something.com/anything
stays as is - But on the server it is handled like this
https://www.something.com/index.php?q=anything
(technicallyhttps://www.something.com/public/index.php?q=anything
)