美文网首页
.htaccess FollowSymLinks

.htaccess FollowSymLinks

作者: CMDY10086 | 来源:发表于2017-12-07 00:33 被阅读0次
  • 开始按照网上的教程写了个.htaccess文件后网站一直403,检查权限并没有什么问题。代码如下
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>

代码目的是将非真正存在的文件全部重定向到index.php中。如果请求的url为http://127.0.0.1/ghghghg 则重定向到index.php并且$_SERVER['REQUEST_URI']为ghghghg。
但实际上却一直出现403错误

  • 将代码添加一行,修改为
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>

后可行

相关文章

网友评论

      本文标题:.htaccess FollowSymLinks

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