Laravel 4 simple route not working using mod_rewrite, and .htaccess

前端 未结 4 676
北恋
北恋 2020-12-08 15:57

I\'m not only new to Laravel 4, but new to using frameworks. I thought I\'d start with Laravel since it\'s gotten such good reviews. I\'ve got a good install of Laravel. I g

相关标签:
4条回答
  • 2020-12-08 16:10

    You need mod_rewrite on. Try: l4/public/index.php/articles

    0 讨论(0)
  • 2020-12-08 16:14

    That Error basically say that the router cannot found your request. Make sure you already save your changes. if you using the artisan command to running the page,just re-run again command "artisan Serve".

    0 讨论(0)
  • 2020-12-08 16:15

    Problem is solved by two editing changes in apache's httpd.conf file.

    AllowOverride None is default. AllowOverride controls whether .htaccess files are processed.

    mod_rewrite is commented out by default.

    Changes to make:

    Change 1: Activate mod_rewrite by uncommenting it.

    Change 2:

    Change

    AllowOverride None
    

    to

    AllowOverride All
    

    Now restart Apache...

    The default .htaccess file that Laravel provides in the public folder specified some mod_rewrite rules. These rules were not getting applied because AllowOverride was set to none. Be sure and restart apache after changing these settings. My configuration: Apache 2.4.6 on Windows XP.

    It appears that there may be some security implications to the AllowOverride change. If anyone has additional information on this, I would like to hear it.

    0 讨论(0)
  • 2020-12-08 16:26

    in httpd.conf change

    <Directory />
        AllowOverride none
        Require all granted
    </Directory>
    

    to

    <Directory />
        AllowOverride all
        Require all granted
    </Directory>
    

    then uncomment

    #LoadModule rewrite_module modules/mod_rewrite.so
    

    to

    LoadModule rewrite_module modules/mod_rewrite.so
    
    0 讨论(0)
提交回复
热议问题