1

I'm using Laravel 5.1 and would remove public from my URL. Any ideas how this is done without renaming files?

3
  • where you want to remove it? on your local machine or any live server ? Commented Feb 26, 2016 at 8:57
  • stackoverflow.com/questions/32806542/… Commented Feb 27, 2016 at 22:23
  • @Steve, if my answer was helpful, please choose my answer as best answer and upvote it. Commented Mar 15, 2016 at 14:04

2 Answers 2

2

You should point your web server (Nginx, Apache, etc) to the public folder, not to the root folder (where app, config, public, etc live).

Sign up to request clarification or add additional context in comments.

Comments

1

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; } 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.