回答編集履歴

3

追記

2020/05/19 03:08

投稿

otn
otn

スコア84661

test CHANGED
@@ -27,3 +27,27 @@
27
27
  ```
28
28
 
29
29
  です。
30
+
31
+
32
+
33
+ #追記
34
+
35
+ `/gate`がディレクトリの場合は、自動的に`/gate`⇒`/gate/`のリダイレクトが掛かるので、上記ではループします。
36
+
37
+ ちゃんと、`/`を付けて、
38
+
39
+ ```Apache
40
+
41
+ RewriteEngine On
42
+
43
+ RewriteCond %{REQUEST_URI} !^/hoge1(/|$)
44
+
45
+ RewriteCond %{REQUEST_URI} !^/hoge2(/|$)
46
+
47
+ RewriteCond %{REQUEST_URI} !^/gate/$
48
+
49
+ RewriteRule ^ /gate/ [R=301,L]
50
+
51
+ ```
52
+
53
+ のように書く必要があります。

2

訂正

2020/05/19 03:08

投稿

otn
otn

スコア84661

test CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  RewriteCond %{REQUEST_URI} !^/hoge2(/|$)
12
12
 
13
- RewriteCond %{REQUEST_URI} !^/gate(/|$)
13
+ RewriteCond %{REQUEST_URI} !^/gate$
14
14
 
15
15
  RewriteRule ^ /gate [R=301,L]
16
16
 

1

コメントを受けての訂正

2020/05/18 13:11

投稿

otn
otn

スコア84661

test CHANGED
@@ -10,11 +10,11 @@
10
10
 
11
11
  RewriteCond %{REQUEST_URI} !^/hoge2(/|$)
12
12
 
13
+ RewriteCond %{REQUEST_URI} !^/gate(/|$)
14
+
13
15
  RewriteRule ^ /gate [R=301,L]
14
16
 
15
17
  ```
16
-
17
-
18
18
 
19
19
 
20
20