Stylesheet does not load after using RewriteRule and include

前端 未结 2 681
盖世英雄少女心
盖世英雄少女心 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

    0 讨论(0)
  • 2020-12-22 12:48

    You might be including it with a relative path? When your'e using ./ you are trying to include something from the new (non excistent?) /welcome dir.

    Try to include your stuff trough the complete path, or use some sort of variable that tells you the real basepath.

    0 讨论(0)
提交回复
热议问题