Link to home
Start Free TrialLog in
Avatar of Bruce Gust
Bruce GustFlag for United States of America

asked on

Why does this page get a 404?

Here's my link:

<a href="{{ url('show/practice/1') }}">Video #1</a>

Here's my route:

Route::get('/show/practice/{id}', 'PracticeController@showPractice')->name('adminShowPractice');

Here's my Controller:

   public function showPractice($id)
    {
        //
            echo $id;
            exit();
      
    }


I'm thinking this should be cake and ice cream, but I keep getting a 404 error saying that this:

http://nomas.site/show/practice/1

...is not found.

Why?
Avatar of Dr. Klahn
Dr. Klahn

This URL as shown relies on behavior in the server that may not be standard.

1.  Typically a web server FQDN begins with "www." -- in this case, the URL does not begin with "www." and the request then goes to a site which may, or may not, be the web server you desire.  Use the proper and full FQDN of the URL in the code which generates the URL.

2.  On some servers, the URL as shown would display the contents of the directory under /show/practice/1.  On other servers, the URL as shown would look for "index.html" in the directory /show/practice/1.  On still other servers, the URL as shown would look for "index.php", "index.shtml", "index.htm" or other variant in the directory /show/practice/1.  Use the proper and full specific file name that is to be accessed in the code which generates the URL.
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bruce Gust

ASKER

Sometimes I look in the mirror and wonder how such a sharp looking guy can be so...

...stupid.

Thanks, Chris! That was it. I'm questioning algorithms and call stacks...

Nope. Just change the link.