I want the public/ folder to be root but I want to ignore everything that comes in the url, but the files in the css, javascript, images folder are accessible.
Example:
http://localhost/ access to public/ folder
http://localhost/css/style.css or http://localhost/js/script.js or http://localhost/images/funny.gif is accessible
I want it when I type http://localhost/news/1?test=helloword
news/1?test=helloword need be ignored, but in PHP when using the parse_url() function I have to have access to all variables, like ['path'],['query;],...
Output:
['path'] => '/news/1'
['query'] => {
['test'] => 'helloword'
}
I'm using PHP to make the server php -S localhost:8000 -t public/ it works very well
but when i enter the apache2 server it doesn't work
I found this on the internet .htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} /public/([^\s?]*) [NC]
RewriteRule ^ %1 [L,NE,R=302]
RewriteRule ^((?!public/).*)$ public/$1 [L,NC]
just don't ignore the [path],[query],...
Hope I'm not being an idiot asking this :/