简体   繁体   中英

Laravel Localhost or pretty url not working

I have installed composer on windows 8 and i am using the webserver xampp,

I did the comand composer global require

composer global require "laravel/installer=~1.1"

I even configure env path for composer like this

set PATH=%PATH%;%USERPROFILE%\AppData\Roaming\Composer\vendor\bin

Then created the project like this

Laravel new myproject

I check the file .htaccess in my public folder of my laravel project,

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

I have checked the module activation for url rewriting in apache httpd.conf

LoadModule rewrite_module modules/mod_rewrite.so

then i test it and i typed many urls and it gives a page not found ERROR !

Here are the url tested:

  • localhost/laravel/
  • localhost/laravel/public
  • localhost/laravel/myproject/
  • localhost/laravel/myproject/public

Did i miss something, i am quite surprised to fix things for hours to use a popular framework like laravel.

From the comment of my question we conclude that laravel has a bug with xampp and the bug was reported 3 days ago on the official bug tracking forum from laravel

Also we have found that my folder structure is too long and it could generate conflict within the configuration of xampp, the advice was to use a virtual host solution, the one advised by laravel is Homestead, so let's try with homestead !

Good luck to everyone who need to fix their xampp server to work with laravel maybe try to use another webserver instead.

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