htaccess - 当URL没有以/结尾时,CSS不加载

时间:2016-10-02 12:21:54

标签: apache .htaccess mod-rewrite url-rewriting

我将.htaccess文件放在con = sqlite3.connect('utpg.db') db = con.cursor() user_id = session.get('id') getpackages = db.execute("SELECT pck_id, client_id, date, price, privatelesson, shortgamelesson, playinglesson, notes FROM packages WHERE client_id = ?;", (user_id, )) packages = getpackages.fetchall() for row in packages: print(row) 目录下。我想重写从example.com/newexample.com/new/it/keyword的每个网址。我目前的example.com/new/index.php?lang=it&keyword=keyword是这样的:

.htaccess

问题是RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+)/(.+) index.php?lang=$1&keyword=$2 [L] 工作正常,但example.com/new/it/keyword/不加载CSS和图片,只加载HTML。我该如何解决?

1 个答案:

答案 0 :(得分:0)

使用样式表和HTML页面中其他资源的绝对路径,例如

<link rel="stylesheet" href="/path/to/css/styles.css">