【发布时间】:2018-08-30 23:57:21
【问题描述】:
我有一个看起来像这样的网址
https://sparkle.000webhostapp.com/movie.php?id=16
我想改成
https://sparkle.000webhostapp.com/movie/16
我已将 .htaccess 文件创建为
Options -MultiViews
RewriteEngine On
# redirect "/movie.php?id=xxx" to "/movie/xxx"
RewriteCond %{THE_REQUEST} \s/movie\.php\?id=([0-9]+)\s [NC]
RewriteRule ^ /movie/%1? [R=301,L]
# internally rewrite "/movie/xxx" to "/movie.php?id=xxx"
RewriteRule ^movie/([0-9]+)$ /movie.php?id=$1 [L]
但问题是样式文件,即没有加载css文件。 链接中没有定义样式
【问题讨论】:
-
你的
<link rel ...元素是什么样的? -
-
如果我不使用 .htaccess 文件。一切都好!但使用 .htaccess 文件链接后转换但未加载 css 文件。