【问题标题】:Subdomain CSS and JS File issue子域 CSS 和 JS 文件问题
【发布时间】:2016-05-24 21:20:26
【问题描述】:

我的 .htaccess 有以下行

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} ^(.*)\.domain\.com
RewriteRule ^(.*)$ index-merchant.php?id=%1 [L,NC,QSA]

如果我进去会发生什么

trytry.domain.com

它将使用 index-merchant.php?id=trytry

有这个问题

我的 css 样式表和 js

<link rel="stylesheet" href="canvas/css/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="canvas/style.css" type="text/css" />

这个文件不起作用,当我点击它们时,它会再次打开网站本身。即使在我做了这个子域 htaccess 之后,我如何让我的 css 和 js 工作

另一个问题是

trytry.domain.com/category/helloworld

我想修改我的 htaccess,使其可以同时捕获 trytry(子域)和查询字符串 helloworld

感谢您的帮助!

【问题讨论】:

    标签: javascript php html css .htaccess


    【解决方案1】:

    如果我理解得很好 尝试在您拥有的每个页面的 head 部分添加基本标记

    应该是这样的

    <base href="http://your_domain/">
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-08
      • 2011-12-24
      • 2015-12-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多