2

I am using laravel 5 and having one problem when i upload my project on rackspace it is showing public/index.php in the url. Without this my project is not working.

Please help me .

Htacesss of my public is this :-

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

With regards Harpartapsingh

  • possible duplicate of [Laravel 5 - Remove public from URL](http://stackoverflow.com/questions/28364496/laravel-5-remove-public-from-url) – Sagar Naliyapara Jul 22 '15 at 06:13

2 Answers2

0

You do this by making the /path/to/laravel/public folder itself your webroot in Apache/nginx instead of /path/to/laravel. With that, and the standard .htaccess in the public folder, you should be able to access your routes without the public or index.php URL segments.

Alana Storm
  • 164,128
  • 91
  • 395
  • 599
  • Rackspace don't allowed my domain to direct redirect to public folder. – Harpartap Singh Permar Jul 22 '15 at 06:53
  • Can you SSH into the server and simply symlink `httpdocs -> public`? i.e. `ln -s public httpdocs`. Assuming your project is **not** inside the doc root (which I think is what Alan means). – Ash Jul 22 '15 at 10:23
0

copy your .htaccess file from your public folder and paste in your root directory with this code inside .htaccess:

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

Jigs Virani
  • 4,067
  • 1
  • 23
  • 24