You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is important to remove trailing slashed from applications made with laravel and it is bad for SEO as Google registers page twice, once with slash and once without it. The correct behaviour is to create 301 for ever page with trailing slash to avoid content duplication in search results.
7
+
It is important to remove trailing slashed from applications made with laravel and it is bad for SEO as Google will index your page twice, once with slash and once without it. The correct behaviour is to create 301 for ever page with trailing slash to avoid content duplication in search results.
8
8
9
9
Here is the source: https://developers.google.com/search/blog/2010/04/to-slash-or-not-to-slash
10
10
11
11
## Before you start
12
12
13
-
An easy way to check if your app is behaving properly would be to create a test route in ``routes/web.php`` like this:
13
+
An easy way to check if your app is behaving properly is to create a test route in ``routes/web.php`` like this:
14
14
15
15
```
16
16
Route::get('/foobar', function () {
17
-
return 'This is not good!';
17
+
return 'simple test';
18
18
});
19
19
```
20
20
21
21
Then visit this endpoint with trailing slash ``yourapp.test/foobar/``
22
22
23
-
If "This is not good!" was displayed and trailing slash did not dissapear from your url in the browser then Google will not be happy about it.
23
+
If "simple test" was displayed and trailing slash did not dissapear from your url in the browser window then Google will not be happy about it and you need to fix it.
0 commit comments