1

Here is my Directory Structure

localhost/project or livehost/project
-app
-bootstrap
-public
-vendor

Where i have /project as a folder inside the htdocs.

Now i am accessing the project by

localhost/project/public/
localhost/project/public/blog  // for submenu

How can i remove the /project/public/ and use only the localhost/project and localhost/project/blog

And if move to live i will be having the project folder as main so How can i have the .htaccess for the localhost (which is inside the project folder) and live (which will be in the root)

Here is the .htaccess i had for the the live (where the files will be on the live)

<IfModule mod_rewrite.c>
    RewriteEngine On 
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
AngularAngularAngular
  • 2,869
  • 5
  • 19
  • 40

2 Answers2

3

Rename the server.php in the your Laravel root folder to index.php and copy the .htaccess file from /public directory to your Laravel root folder. -- Thats it !! :)

llioor
  • 4,096
  • 2
  • 29
  • 38
0

First you have to make sure mod_rewrite is enabled on your server (you can go here if you don't know how to do). If it's already enabled but URL rewrite seems to not work, you can refer to "pretty URL" chapter of Laravel's documentation : http://laravel.com/docs/4.2/installation#pretty-urls

Community
  • 1
  • 1
rap-2-h
  • 23,287
  • 23
  • 130
  • 217