美文网首页
使用thinkphp5 设置了路由还是404的解决方案

使用thinkphp5 设置了路由还是404的解决方案

作者: coderYJ | 来源:发表于2018-12-15 14:49 被阅读112次

使用thinkphp框架之后设置路由仍然是404问题

    1. 开启apache重写(conf/httpd.conf)
      LoadModule rewrite_module modules/mod_rewrite.so
  • 2.允许在任何目录中使用“.htaccess”文件,将“AllowOverride”改成“All”(默认为“None”):
<VirtualHost *:80>
    DocumentRoot "/Users/xmg/Desktop/www/tp5/public"
    ServerName www.tp.com
    ErrorLog "/private/var/log/apache2/dummy-host2.example.com-error_log"
    CustomLog "/private/var/log/apache2/dummy-host2.example.com-access_log" common
    <Directory "/Users/xmg/Desktop/www/tp5/public">
        Options FollowSymLinks Multiviews
        MultiviewsMatch Any
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
需要在这里设置为All才能生效

相关文章

网友评论

      本文标题:使用thinkphp5 设置了路由还是404的解决方案

      本文链接:https://www.haomeiwen.com/subject/pxrahqtx.html