希望一切都很好。我已经将laravel应用程序部署到了heruko。
这是我的htacss文件:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/index.php?$1 [END,QSA]
</IfModule>
我的路线文件夹中也有
1- api.php
use Illuminate\Http\Request;
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
Route::middleware('cors:api')->get('/stores', function (Request $request, Response $response) {
return App::make('App\Http\Controllers\ApiData')->{'GetStores'}();
});
Route::middleware('cors:api')->post('/RegisterLocation', function (Request $request, Response $response) {
return App::make('App\Http\Controllers\ApiData')->{'RegisterLocation'}();
});
Route::middleware('cors:api')->post('/SearchPartner', function (Request $request, Response $response) {
return App::make('App\Http\Controllers\ApiData')->{'SearchPartner'}();
});
and
Web.php
<?php
Route::get('/', function () {
//Route::get('/', 'UserController@show');
return view('welcome');
});
Route::get('/stores', function() {
return App::make('App\Http\Controllers\UserController')->{'show'}();
});
我输入的任何网址如何将我重定向到索引页?
任何原因吗?
谢谢。