简体   繁体   中英

Remove /index.php/ from URLs on Virtual Host on Laravel app

I have a Laravel app on localhost that works, there is no /index.php/ because of the .htaccess file, I guess.

But for certains reasons I had to use a virtual host from Apache2 that I have called "website.dev" and now the /index.php/ string appaers in all my URLs

Can you help please?

I tried this:

<Directory /var/www/html>
   AllowOverride All
</Directory>

Try to add this to .htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM