'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:

  1. Create local directory in your project directory.
  2. Move all files and folders except public directory in the local directory.
  3. Move all files and folders from public directory to project directory and remove public directory.
  4. 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';
  5. 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