teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

追記

2020/11/26 12:07

投稿

otn
otn

スコア86349

answer CHANGED
@@ -6,4 +6,10 @@
6
6
  RewriteRule ^(js/.*) /test/sample/$1
7
7
  ```
8
8
  ドキュメントルート直下に、別の`css`や`js`ディレクトリがあるとそれらも全部リライトするので、
9
- その場合はリファラーを見るなどが必要です。
9
+ その場合はリファラーを見るなどが必要です。
10
+
11
+ ```Apache
12
+ RewriteEngine on
13
+ RewriteCond %{HTTP_REFERER} ^https://example.com/test/sample/
14
+ RewriteRule ^((css|js)/.*) /test/sample/$1
15
+ ```