laravelroutesserve

301 Moved Permanently on post ajax requests in laravel


I upload a laravel project on server; When I run all the ajax post request request run like this:

Request URL: http://example.com/user/register/
Request Method: POST
Status Code: 301 Moved Permanently

Then this run:

Request URL: http://example.com/user/register
Request Method: GET
Status Code: 500 Internal Server Error (from disk cache)

Post method change to get method and return error; How can I solve this?!

I try php artisan cache:clear php artisan config:clear php artisan view:clear But also return error


Solution

  • I found the answer. put here to help the others. It take so time of me. The problem was so simple. I just remove the backslash from end of url of each post actions.

    For example /user/register/ must change to /user/register :|

    And cache of the browser must be clear for each page.