0

I have the simple code in my routes.php:

Route::get('/', function()
{
    return View::make('hello');
});


Route::get('/mypage', function()
{
    echo 'mypage';
});

Visiting mysite.dev/ will return the hello view. However, visiting mysite.dev/mypage gives me a 404. In my phpinfo(); I'm showing mod_rewrite enabled (as seen here: https://www.dropbox.com/s/u972n1rcdbsambg/Screenshot%202014-07-09%2022.27.04.png)

Any idea why this wouldn't work? I'm running Mac OS X Mavericks with apache2 and PHP with Laravel 4.

3 Answers 3

1

Have you changed this from

AllowOverride None

to

AllowOverride All

in your apache2.conf?

Sign up to request clarification or add additional context in comments.

1 Comment

That was it! We're back in business! Thanks so much for the help!
0

You should try returning echo:

Route::get('/mypage', function()
{
    return echo 'mypage';
});

I hope this helped, cheers!

2 Comments

Could you check (assuming you are using apache) that your override settings is set to all. You can find the folder in /etc/apache2/sites-enabled/*.conf
returning echo? really?
0

Sounds like you could be missing the .htaccess file - it's super easy to miss this if you're copying files with finder on OS X because dotfiles are hidden by default.

Check that this file is in your /public directory - https://github.com/laravel/laravel/blob/master/public/.htaccess

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.