.htaccess - Removing public form laravel url? -


i removing public laravel url using .htaccess writing code on htaceess file

<ifmodule mod_rewrite.c>     rewriteengine on     rewriterule ^(.*)$ public/$1 [l] </ifmodule> 

htacces file in root of laravel , mode_rewrite enable after getting error sorry, page looking not found. can still welcome page http://localhost/laravel/public/ please solve issue

your web server configuration wrong. should point web server public directory.

for example, if you're using apache, should set this:

<virtualhost *:80>   servername myapp.localhost.com   documentroot "/home/vagrant/projects/myapp/public"   <directory "/home/vagrant/projects/myapp/public">     allowoverride   </directory> </virtualhost> 

in xammp, mamp, openserver etc. need change root directory laravel's public directory.

also, don't forget restart web server make work.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -