Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel 5路线仅适用于斜线_Php_Laravel_Laravel 5_Wamp_Wampserver - Fatal编程技术网

Php Laravel 5路线仅适用于斜线

Php Laravel 5路线仅适用于斜线,php,laravel,laravel-5,wamp,wampserver,Php,Laravel,Laravel 5,Wamp,Wampserver,我在控制器中编写了以下代码。带斜杠的代码正在工作,但带引用的代码不工作 每当我不使用斜杠时,就会出现500个内部服务器错误 Route::get('/', 'WelcomeController@index'); Route::get('welcome', function() { return 'Welcome Page'; }); 以下是我的.htaccess文件 <IfModule mod_rewrite.c> <IfModule mod_negotia

我在控制器中编写了以下代码。带斜杠的代码正在工作,但带引用的代码不工作

每当我不使用斜杠时,就会出现500个内部服务器错误

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

Route::get('welcome', function()
{
    return 'Welcome Page';
});
以下是我的.htaccess文件

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

    RewriteEngine On

    RewriteEngine On RewriteBase

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

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

选项-多视图
重新启动发动机
基于RewriteBase的RewriteEngine
#重定向尾部斜杠。。。
重写规则^(.*)/$/$1[L,R=301]
#处理前控制器。。。
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^index.php[L]
下面是conf文件

Alias /pitcher.dev "C:/wamp/www/pitcher.dev/public/" 

<Directory "C:/wamp/www/pitcher.dev/public/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order allow,deny
    Allow from all
</Directory>
Alias/pitcher.dev“C:/wamp/www/pitcher.dev/public/”
选项索引跟随符号链接多视图
允许超越所有
命令允许,拒绝
通融

我正在使用windows和wamp服务器。mod_rewrite已启用。

尝试删除RewriteBase上的这一行
RewriteEngine
,当您的
.htaccess
代码错误时,会发生AFAIK 500内部服务器错误:D


尝试将
选项索引跟随ymlinks多视图更改为
选项索引跟随ymlinks

运行
php artisan route:clear
以确保您的路由未被缓存。我尝试过,但仍然无法正常工作,什么是“不工作”?你有404吗?空白屏幕?500? 等…当我使用斜杠时,然后没有错误,否则我会得到500个内部服务器错误。我尝试在RewriteBase上删除
RewriteEngine
,但也没有成功。