Error 405 Method Not Allowed #1341
Replies: 4 comments
-
Based on the information in the knowledge sources: 1. Is it possible for Backpack routing to generate a 405 Method Not Allowed?There is no explicit evidence in the knowledge sources that Backpack's routing itself would generate a 405 Method Not Allowed error for the root of your app (e.g., /myapp/). Most issues related to 405 errors in Backpack are tied to specific CRUD operations (like DELETE actions) or misconfigured custom routes, not the root path. In your case, since /myapp/index.php and /myapp/admin work as expected, and the only difference is the 405 on /myapp/, this strongly suggests a server or .htaccess/web server configuration issue, especially since you mention Litespeed and cPanel environments, which are known to sometimes handle rewrites differently than Apache or Nginx. This is supported by similar reports where server configuration (such as missing .htaccess or incorrect VirtualHost settings) caused routing issues, not Backpack itself Deploy Backpack for Laravel in production, Error 404 after first login, Need some help after installation on Laravel project. 2. Can you create a route on /myapp/ that redirects to /myapp/admin?Yes, you can define a custom route in your Laravel application's web.php or in a Backpack custom routes file to handle this. For example, in your routes/web.php: Route::get('/', function () {
return redirect('/admin');
}); Or, if your app is in a subfolder and you want to ensure the redirect works correctly, you might use: Route::get('/myapp', function () {
return redirect('/myapp/admin');
}); You can also place such a route in your custom Backpack routes file (e.g., routes/backpack/custom.php). This is a standard Laravel approach and is supported by Backpack's flexibility in customizing routes Customize the routes. Summary
If the problem persists after adding the redirect, it further points to a server configuration issue rather than a Backpack or Laravel routing problem. ℹ️ Please note our AI Bot does not reply to follow-ups, this will be the only AI answer in this thread. If the AI helped you find the answer, please mark it as answered or write details below so it can learn. Then close the conversation. If not, please give more information for when a human reads this. ℹ️ Relevant sources: Github Issue (closed): Error 404 after first login |
Beta Was this translation helpful? Give feedback.
-
Hey @qontori Can you please check the Also make sure to remove the old cache: |
Beta Was this translation helpful? Give feedback.
-
Thanks. my app_url is https://mydomain.com/myapp my laravel folder is at /home/username/laravelproject the entire app is working except https://mydomain.com/myapp which gives the 405 With regards to the
this doesnt solve the problem. |
Beta Was this translation helpful? Give feedback.
-
Solved :) I included this in the .htacces in mydomain.com/
I have the .htaccess in /myapp/ as
in my web.php i have
now if i can learn to hide the admin, but i can live with that :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a production server, a development server and a new development server (shutting down the hold). I have Backpack Pro v6 core UI 2 and hosting on a shared Cpanel environment. Both the product server and development server are running as expected.
both production and development are set up the same except username is different
my backpack/laravel app is at
/home/username/approot
the public folder is at
/home/username/public_html/myapp such users visit the page at mydomain.com/myapp/index.php
a user entering mydomain.com/myapp will redirect to the welcome page and mydomain.com/myapp/admin redirects to either login or dashboard depending on login state
the new development follows the above identically except for username as well and gets different results
mydevdomain.com/myapp/index.php loads and runs the app as expected as does mydevdomain.com/myapp/admin
however mydomain.com/myapp generates a 405 method not allowed.
The hosting company says the problem is with the laravel/backpack routing however
From everything I can tell it is a litespeed configuration on rewriting on the folder but have no way of proving this in a cpanel environment.
My Question
Thanks in advance for your help
Beta Was this translation helpful? Give feedback.
All reactions