3

I got an error saying

Not Found

The requested URL /about was not found on this server.

I have this routes

Route::get('/', 'megamitch@index');
Route::get('home', 'megamitch@index');
Route::get('about', 'megamitch@about');
Route::get('loan-products', 'megamitch@loanproducts');
Route::get('careers', 'megamitch@careers');
Route::get('contact', 'megamitch@contact');

if I do "php artisan route:list" I can see that those routes really exist. Im running on wamp server where that issue exist (same issue on the live web server), however if i run my app through "php artisan serve" all pages works. Any ideas, help?

PS: only this route "Route::get('/', 'megamitch@index');" works.

Juliver Galleto
  • 8,831
  • 27
  • 86
  • 164

1 Answers1

2

It sounds like your rewriting isn't working. If you add index.php to the URL right before the /about does it work?

For example, yourdomain.com/about would become yourdomain.com/index.php/about

If your rewriting isn't working, but you have the .htaccess file in your public directory, then you probably need to allow overrides in your apache configuration. Here is an example virtual host configuration for WAMP and Laravel.

I've marked the lines you need to change. Change the first and third to point to the public directory in your website's directory. Then change the second line to the domain name you're using with your website.

<VirtualHost *:80>
    DocumentRoot "C:/wamp/www/yourdomain/public"      # Change this line
    ServerName yourdomain.com                         # Change this line
    <Directory "C:/wamp/www/yourdomain/public">       # Change this line
        Options Indexes FollowSymLinks ExecCGI Includes
        AllowOverride All    # This line enables .htaccess files
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

You'll need to restart Apache for these settings to take effect.

BrokenBinary
  • 7,731
  • 3
  • 43
  • 54