gpt4 book ai didi

html - Effect Permalink .htaccess 加载css文件

转载 作者:太空宇宙 更新时间:2023-11-04 15:08:51 26 4
gpt4 key购买 nike

我有

localhost/ctr/index.php?page=reload

我使用 htaccess 将它们转换成

localhost/ctr/index/reload

它是 htaccess

RewriteEngine on

RewriteRule index/([a-z]+) index.php?page=$1 [NC]

这项工作,出现带有新格式 url 的页面。

但是加载css文件出现问题如下:

link href="templates/plugin/bootstrap/css/bootstrap.css" type="text/css" rel="stylesheet" 

我认为 css 文件加载会影响我在 htaccess 中所做的安排。

我该如何解决。

最佳答案

RewriteEngine on

RewriteCond %{DOCUMENT_ROOT} !-f
RewriteRule !\.(js|ico|gif|jpg|png|css|html|swf|flv|xml)$ index.php [QSA,L]

试试这个 rewrite-all-url-to-index-php-except-from-serene-assets

关于html - Effect Permalink .htaccess 加载css文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15583864/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com