1

I have seen many questions like this, which solve in removing public in cases like example.com/public. But in my case i have example.com/cases/public. How to deal with this type of situatations.

8
  • Does your DocumentRoot (apache) or root (nginx) point to yourlaravelproject/public? Commented Aug 24, 2015 at 8:44
  • i don't know much about documentroot fir what i see here httpd.apache.org/docs/2.2/mod/core.html#documentroot, my document root is /project/cases Commented Aug 24, 2015 at 8:49
  • It should point to /project/cases/public. Commented Aug 24, 2015 at 8:49
  • how to achieve that? Commented Aug 24, 2015 at 8:51
  • Are you working on a localhost or on a remote server? If on localhost are you using some package as XAMPP, EasyPHP, MAMP (depending on your OS)? If on a remote server - is it a shared hosting or a dedicated server (VPS)? Commented Aug 24, 2015 at 8:58

2 Answers 2

1

Follow this steps to remove the public from url

  1. Copy .htaccess file from /public directory to Laravel/project root folder.
  2. Rename the server.php in the Laravel/project root folder to index.php.

Cheers your will be good now.

Please Note: It is tested for Laravel 4.2, Laravel 5.1, Laravel 5.2, Laravel 5.3.

I think this is the easiest way remove public.

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

Comments

0

If you want to remove cases/public from url than you can use this

RewriteBase / RewriteRule ^cases/public http://example.com/ [R=301,L]

Remove direction R=301 in above line to make it internal redirection

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.