Laravel 4 Removing Public from Url

remove Laravel 4.2 /public from url

Normally you need the htaccess file to point to the public folder. But you can copy the content of the public folder in your root folder and change the app path to it.

Copy your index file in your root folder and add this to your index.php file:

// set the public path to this directory
$app->bind('path.public', function() {
return __DIR__;
});

Laravel 8.4 – Remove Public from URL

To remove the /public from the URL you are not going to use the .htaccess file.

What you are going to do instead is set the /public folder as the serving directory for your Server.

If you use Apache, just go to your /etc/apache2/sites-available/000-default.conf file and change the DocumentRoot from {your base folder}/ (usually /var/www) to {your base folder}/public

How to remove public from laravel url

If you have done 2 steps already have you change the index.php having vendor folder path inside remove the /../ and everything work fine

$app = require_once __DIR__/../'/bootstrap/app.php';

to

$app = require_once __DIR__.'/bootstrap/app.php'; 

How to remove public from URL in laravel 4.2

I already copied the .htaccess file from /public directory to my Laravel root folder.Also I renamed the server.php in the my Laravel root folder to index.php and its worked for me.

Remove /Public from url in Laravel

.htaccess files wont work on this, what i did is i update the root directory in my server side.

instead the root will be at public_html I change it to public_html/public



Related Topics



Leave a reply



Submit