为什么我将favicon.ico作为http get请求获取?

时间:2016-02-17 06:29:06

标签: php apache .htaccess laravel httprequest

我正在使用laravel 5.2,我写了一条这样的路线:

Route::group(['middleware' => 'web'], function () {
    Route::get('/country/{locationName}', ['as' => 'country', 'uses' => 'HomeController@getCountry']);
}); 

然后当我打开我的page.com/country/argentina时,我从网址中获取locationName没有问题。但是,如果我多次按f5,那么我的变量$ locationName有时会得到“favicon.ico”而不是“argentina”。

嗯,我不认为这是一个laravel问题。这真的是一个简单的代码。它可能是.htaccess或apache配置中的问题吗?

不过,这是我的.htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # SSL From cloudflare
    RewriteCond %{HTTP:X-Forwarded-Proto} =http
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

0 个答案:

没有答案