1

I used Laravel5.2 for my websites for example (http://amirhome.com)

I tried several ways for remove public from my url project,

  • Way 1. using .htaccess
  • Way 2. using Content Moving
  • Way 3. using rename server.php

but Technology Lookup online tools for example (http://builtwith.com/) don't detected my project framework (Laravel).

How to remove “/public” from the URL path in Laravel 5.2 that detected with technology profiler tools, like http://laravel.com

enter image description here

Amir Hosseinzadeh
  • 7,360
  • 4
  • 18
  • 33

2 Answers2

1

You need to point you web server to public directory instead of root one:

For Apache you can use these directives:

DocumentRoot "/path_to_laravel_project/public"
<Directory "/path_to_laravel_project/public">

For nginx, you should change this line:

root /path_to_laravel_project/public;
Community
  • 1
  • 1
Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279
-1

I modified my .htaccess in root my website www.amirhome.com

enter image description here

<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]

    RewriteCond %{HTTP_HOST} !=localhost
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

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

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Libwww-perl Access Test
    RewriteCond %{HTTP_USER_AGENT} libwww-perl.* 
    RewriteRule .* ? [F,L]
</IfModule>
Amir Hosseinzadeh
  • 7,360
  • 4
  • 18
  • 33