Search code examples
phplaravelprofilerfeature-detection

How to remove “/public” from the URL path in Laravel 5.2 that detected with technology profiler tools


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


Solution

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