I have a problem on my Laravel project using Apache. I am trying to access some network shared folders this way:
$directory = "\\fileserver\public\office\technology";
$items = scandir($directory);
I got this link right here (/office/technology) and it works!
Then when I click for a redirect it doesn't work using Apache service (404 Apache error).
I googled some results and I think that's an .htaccess or http-vhosts.conf configuration error.
.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
httpd-vhosts.conf
<VirtualHost *:80>
ServerName test.vr.it
DocumentRoot "C:/xampp/htdocs/intranet/public"
ErrorLog "logs/test.vr.it-error.log"
<Directory "C:/xampp/htdocs/intranet/public">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
I also have mod_rewrite enabled but I get 404 error. Can someone help me? Thanks a lot
It works only with php artisan serve command so it's an apache configuration error
lang-php
php artisan serveusesphpin the background to have a server, it does not useapacheat all. Never usephp artisan serve, always useapacheornginx(useSailif you don't know how to create your own local environment for development using Docker Compose)php artisan servewhich have local user permissions