.htaccess - Laravel 5.1 | Post requests don't work without the "/public" in the URL -


as title says,

post requests don't work without "/public" in url in laravel 5.1

for example, in login form if action url

/auth/login 

it not work , redirects me login page again after submitting it, if change action url to

/public/auth/login 

it works correctly. same other forms.

here .htaccess file located in laravel root folder

<ifmodule mod_rewrite.c> rewriteengine on  rewritecond %{request_uri} !^public rewriterule ^(.*)$ public/$1 [l] </ifmodule> 

and here .htaccess file located in public folder

options +followsymlinks rewriteengine on  rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [l] 

btw, app published on godaddy shared hosting account. problem not exist on local server (wamp)

how solve ? in advance.

the problem existed because of using url() method.

for example in login.blade.php file => login form when changed

action="{{url('auth/login')}}" 

to this

action="{{action('auth\authcontroller@postlogin')}}" 

and changed route name of login action

/login  

instead of

/auth/login 

it worked. doubt reason may form submitting url same url of current page containing form.


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -