In Laravel 5 how to run project run without php artisan or run your project in local server using the URL example: http://localhost/project_name/
Let's we go through step by step to run project.
Here we go in Laravel 5 – Remove Public from URL
Step 1. Renaming the server.php to index.php (no any modifications)
Step 2. Copy the .htaccess from public folder to root folder
And Changing .htaccess it a accessing js, images, access paths.:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]
No comments:
Post a Comment