The Requested Url /Projectname/Users Was Not Found on This Server. Laravel

The requested URL /ProjectName/users was not found on this server. Laravel

Steps for Apache Web Server and Laravel in Linux Environment.

  1. Open httpd.conf

    sudo vim /etc/httpd/conf/httpd.conf
    # for debian users: /etc/apache2/apache2.conf
  2. Make sure the DocumentRoot is pointing to the laravel project's public directory

  3. Add the Directory element for that path and Allowoverride All... as follows

    DocumentRoot "/var/www/html/laravel/public/"

    <Directory "/var/www/html/laravel/public">
    Allowoverride All
    </Directory>
  4. Open .htaccess from ../laravel/public/ and make sure it has the following

    <IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
    Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
    </IfModule>
  5. Restart httpd services

    sudo service httpd restart
  6. Now http://DomainServer/users will work in your browser.

laravel the requested url was not found on this server

This looks like you have to enable .htaccess by adding this to your vhost:

<Directory /var/www/html/public/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

If that doesn't work, make sure you have mod_rewrite enabled.

Don't forget to restart apache after making the changes! (service apache2 restart)

URL was not found on this server laravel

You need to setup .htaccess rewrite on your server. You may need to install and enable the mod_rewrite apache module (or similar alternative for your chosen http server).

Check that the public folder for your app has a .htaccess file, similar to:

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>

RewriteEngine On

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

See latest laravel release.

laravel 5.0: The requested URL was not found

Try to enable mod_rewrite and change folder permissions:

sudo chmod 755 -R laravel_folder
chmod -R o+w laravel_folder/storage


Related Topics



Leave a reply



Submit