Stylesheet does not load after using RewriteRule and include

前端 未结 2 692
盖世英雄少女心
盖世英雄少女心 2020-12-22 12:15

I have a website that has an index.php, a few simple .html pages and one .php page (contact form) as well as a .htaccess file. On my website I have buttons that point to the

2条回答
  •  一向
    一向 (楼主)
    2020-12-22 12:31

    If the stylesheet is being included using a relative path, then that would be the problem. Try using: /path/to/style.css rather than relative/path/to/style.css

    So if your stylesheet lives in templates/style.css and you reference it as such, when you rewrite the URL http://www.site.com/index.php?page=welcome to http://www.site.com/welcome/, the stylesheet's path is relative to that:

    http://www.site.com/welcome/templates/style.css

提交回复
热议问题