.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

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -