CSS not loading after redirect with htaccess rewrite rule

前端 未结 12 2292
自闭症患者
自闭症患者 2020-12-03 05:18

I have the following Short-hand for a user profile url

RewriteRule ^(\\w+)/?$ ./profile.php?name_of_user=$1

The site is styled with the app

12条回答
  •  执念已碎
    2020-12-03 05:56

    the easiest way to fix this is to specify the full path to your CSS file in the of the HTML file.

    If your mod_rewrite rule is modifying the path to where your CSS file is, you'd also want to place this before your RewriteRule:

    RewriteCond %{REQUEST_FILENAME} !-f
    

    This makes sure that the request doesn't match a file before rewriting it.

提交回复
热议问题