When you are working with Laravel framework and get the requested URL was not found on this server. Laravel apache, means that rewrite mode is disable in .htaccess
. To activate rewrite mode in .htaccess, so find and open .htaccess
, which is located inside xampp/htdocs/laravel_project/public directory on the Windows system.
Here are steps to fix the requested URL was not found on this server. laravel xampp windows:
Step 1: Navigate Xampp/htdocs Directory
Now, Go to C:\xampp\htdocs\ directory.
Step 2: Open Laravel Project Folder in the Editor
Now open your laravel project folder in any text editor from the \xampp\htdocs\
directory.
Step 3: Configure .htaccess File
Now navigate to the public directory in the Laravel project directory, open the .htaccess
file, And simply add the following code into it:
<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]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Step 4: Restart Xampp Windows
To restart your xampp server again on Windows, and as well as clear laravel app cache using php artisan cache:clear command on cmd, and you will see your error resolved.
Conclusion
That’s it; You have learned how to resolve error the requested url was not found on this server. laravel xampp windows.