.htacces删除页面样式

时间:2016-03-09 09:38:31

标签: css .htaccess

我正在试图弄清楚.htacces RewriteRule是如何工作的。

这是我的网址,摆弄着.htacces:

http://mysite.nl/gve/home

这是:

http://mysite.nl/gve/index.php?p=1

我想要实现的是“gve”子目录中的任何路径都被重定向到“gve / index.php”页面。

我已经完成了上述工作。

我想要实现的下一件事是,当它移动到网站的根目录时,上述内容将起作用。

我尝试了以下内容:

RewriteRule ^(.*)/index gve/index.php [NC,L]

但这似乎从我的页面中删除了所有样式。如下所示。

这是网址:

http://mysite.nl/asdf/index

http://prntscr.com/aczxje

为什么会发生这种情况,我该如何解决?

编辑:CSS链接

    <!-- BEGIN THEME STYLES -->
    <link href="assets/base/css/plugins.css" rel="stylesheet" type="text/css" />
    <link href="assets/base/css/components.css" id="style_components" rel="stylesheet" type="text/css" />
    <link href="assets/base/css/themes/custom_theme.css" rel="stylesheet" id="style_theme" type="text/css" />
    <link href="assets/base/css/custom.css" rel="stylesheet" type="text/css" />
    <!-- END THEME STYLES -->

编辑2: 我的目录结构: enter image description here

1 个答案:

答案 0 :(得分:0)

只需在RewriteCond %{REQUEST_URI} !\.(?:css|js)$ [NC] RewriteRule ^(.*)/index gve/index.php [NC,L] 中添加此行,例如

x
相关问题