tp5文件路径会戴上index或admin,导致图片css之类的加载错误

试了很多方法,发现基本都是由于.htaccess的问题,只要隐藏掉index.php即可,所以修改.htaccess为以下代码

<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    #RewriteCond $1 !^(DATA|images|otherThings)
    RewriteRule ^(.*)$ index.php?s=/index/$1 [QSA,PT,L]
</IfModule>

猜你喜欢

转载自www.cnblogs.com/seanpan/p/11311350.html