谁一开始就是大神?

phpstudy的apache集成环境,开启URL美化不能访问,关闭美化正常访问,还望小伙伴点点[2.0]

开启美化:

URL美化.png

关闭美化url:

URL没美化.png

相关代码:
 'urlManager' => [
    'enablePrettyUrl' => true,
    'showScriptName' => false,
    'rules' => [],
 ],
 apache相关配置:
     已加载LoadModule rewrite_module modules/mod_rewrite.so模块
 vhosts相关配置:
  <Directory "D:\WWW\demo\backend\web">
      Options FollowSymLinks ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
      Require all granted
  </Directory>
 

web目录加个文件.htaccess
代码:Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
RewriteRule \.svn\/ /404.html
RewriteRule \.git\/ /404.html

赞(0) 打赏
未经允许不得转载:菜鸟之家 » phpstudy的apache集成环境,开启URL美化不能访问,关闭美化正常访问,还望小伙伴点点[2.0]

评论 抢沙发

登录

找回密码

注册