I have put the project in subfolder and use server.php and .htaccess to handle request from there , First pages of livewire component works fine (those whose route are defined in web.php) other update post request didt work , The project works fine in PHP artisan serve,
I am using xammp , PHP 8.1, livewire3, in HandleRequests add /lmapnext
lmapnext\vendor\livewire\livewire\src\Mechanisms\HandleRequests\HandleRequests.php
function boot()
{
app($this::class)->setUpdateRoute(function ($handle) {
return Route::post('/lmapnext/livewire/update', $handle)->middleware('web');
});
$this->skipRequestPayloadTamperingMiddleware();
}
in config/livewire
'asset_url' => '/lmapnext/livewire/livewire.js',```
.htaccess
Options -MultiViews
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]
RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php
```
how can i solve this issue i have to use subfolder method
tried cache clear , this question is posted many time but didt found any soultion
I found a possible solution to your problem (and mine) at https://laracasts.com/discuss/channels/livewire/livewire-livewiremessagename-returns-404-on-deployed-site?page=1&replyId=907910
Inside the boot mehotd of a Service Provider (I selected in the RouteServiceProvider for consistency) you add the next code:
It worked for me, hope it works for you.