'How to use resource urls that begin with slash in a normal php website?
I have converted a Laravel website into a normal PHP website by following these steps:
- Create local directory in your project directory.
- Move all files and folders except public directory in the local directory.
- Move all files and folders from public directory to project directory and remove public directory.
- Open index.php file and replace require __DIR__.'/../bootstrap/autoload.php'; with require __DIR__.'/local/bootstrap/autoload.php'; AND $app = require_once __DIR__.'/../bootstrap/app.php'; with $app = require_once __DIR__.'/local/bootstrap/app.php';
- Now you can run your project without artisan serve command "http://localhost/project"
However, the problem is that all urls in my laravel project begin with a forward slash '/' such as "/css/style.css". Such urls are not working after doing the above steps. How can I make them work?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
