路由和超文本的奇怪行为

I am learning webdevelopment. For now the root address of my website is extended like www.mywebsite.com/project2/project2/public. There is a hypenrlink from one page to a route:

<a href="/movetocomplete/{{$object->id}}">{{$object->name}}</a>

If the href is left as above, there is a 404 error saying that there is nothing at

www.mywebsite.com/movetocomplete/id#.

But if the href is

project2/project2/public/movetocomplete/{{$object->id}},

there is a 404 error saying there is nothing at

www.mywebsite.com/project2/project2/public/project2/project2/publicmovetocomplete/id#.

The route is

Route::get('/movetocomplete/{object}', 'UserController@movetocomplete');

I think your Route for this link should not begin with a slash.

The correct route for this url

Route::get('movetocomplete/{object}', 'UserController@movetocomplete');

And only the welcome root page needs a slash, just one slash.

Route::get('/', 'WelcomeController@index');

This is the minimum configuration for Nginx location block:

location / {
    try_files $uri /index.php$is_args$args;
}

location ~ ^/index\.php(/|$) {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param DOCUMENT_ROOT $document_root;

    internal;
}

location ~ \.php$ {
    return 404;
}