-1
I’m having a problem, I recently deployed a 6 Airframe project in production.
I have the following route:
Route::get('/', function () {
return view('welcome');
});
Route::resource('email', 'EmailController');
Locally access http://localhost/project/public/email and normally access the route, but when access in production, returns error 404.
My . htaccess is like this
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
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
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
In production you are trying to access also with
public/email
why it should behttp://SeuendEndereço/email
– Erlon Charles
I am... ip/project/email
– Breno Formiga
And what appears?
– Erlon Charles
From the 404, as if the route did not exist
– Breno Formiga
If you have not configured your system to open without public, on the route you will have to also.
http://SeuendEndereço/public/email
– Glenys Mitchell
@Glenysmitchell but the route has, this is just the problem
– Breno Formiga
What methods do you have in the controller?
– Glenys Mitchell
Only Defalut, index, create, store, show, Edit, update, Destroy. but it doesn’t even go to the controller. not on the server, it works locally
– Breno Formiga
As you are using Resource, check existing routes with
php artisan route:list
– Jeferson Rodrigues
I’ve looked over there, and it’s all right pointing the right way. as I said on the spot everything works, not something in the route or in the controller... I believe it is something in relation to the server configuration
– Breno Formiga
Basically, I have done everything possible... I did a test, when doing the route Route::Resource('/', 'Emailcontroller'); it calls my controller correctly, when I leave it Route::Resource('email', 'Emailcontroller'); it is not called public/email, error 404
– Breno Formiga