I'm using Laravel 5.1 and would remove public from my URL. Any ideas how this is done without renaming files?
- where you want to remove it? on your local machine or any live server ?Qazi– Qazi2016-02-26 08:57:26 +00:00Commented Feb 26, 2016 at 8:57
- stackoverflow.com/questions/32806542/…Sam Solomon– Sam Solomon2016-02-27 22:23:08 +00:00Commented Feb 27, 2016 at 22:23
- @Steve, if my answer was helpful, please choose my answer as best answer and upvote it.Alexey Mezenin– Alexey Mezenin2016-03-15 14:04:43 +00:00Commented Mar 15, 2016 at 14:04
Add a comment |
2 Answers
Change your webserver's root directory to the public folder.
For example, an NGINX configuration is below:
server { listen *:80; server_name local.dev; client_max_body_size 1m; root /var/www/html/PROJECT/public; index index.html index.htm index.php; access_log /var/log/nginx/nxv_vfoa8j7qzdhl.access.log; error_log /var/log/nginx/nxv_vfoa8j7qzdhl.error.log; location / { root /var/www/html/PROJECT/public; try_files $uri $uri/ /index.php$is_args$args; autoindex on; index index.html index.htm index.php; } location ~ \.php$ { root /var/www/html/PROJECT/public; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(/.*)$; try_files $uri $uri/ /index.php$is_args$args; include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param APP_ENV dev; } sendfile off; }