質問編集履歴

2

「実行したいこと」の2行目以降を追記。

2023/01/26 21:58

投稿

kp4livateen
kp4livateen

スコア32

test CHANGED
File without changes
test CHANGED
@@ -8,6 +8,12 @@
8
8
  ### 実現したいこと
9
9
 
10
10
  メインからサブドメインに301リダイレクト処理を実行したい。
11
+
12
+ ・メイン(https://example.com/article1/)(https://example.com/article2/)(https://example.com/article3/)
13
+ →サブ(https://sub.example.com/article1/)(https://sub.example.com/article2/)(https://sub.example.com/article3/)
14
+
15
+ ・メイン(https://example.com/article4/)
16
+ →サブ(https://sub.example.com/article4-new/)
11
17
 
12
18
  ### 発生している問題・エラーメッセージ
13
19
 

1

「その他」部分を追記しました。

2023/01/26 20:08

投稿

kp4livateen
kp4livateen

スコア32

test CHANGED
File without changes
test CHANGED
@@ -15,11 +15,24 @@
15
15
 
16
16
  ### 該当のソースコード
17
17
 
18
- ```ここに言語名を入力
18
+ ```Apache
19
19
  # BEGIN リダイレクト
20
20
  RewriteEngine On
21
21
  RewriteRule ^(article1|article2|article3)$ https://sub.example.com/$1 [R=301,L]
22
22
  RewriteRule ^article4$ https://sub.example.com/article4-new/ [R=301,L]
23
23
  # END リダイレクト
24
24
  ```
25
+ ### その他
25
26
 
27
+ 上記で合ってると思うのですが、単純に反映に時間がかかっているのでしょうか?
28
+
29
+ ```Apache
30
+ # BEGIN リダイレクト
31
+ <IfModule mod_rewrite.c>
32
+ RewriteEngine On
33
+ RewriteRule ^(article1|article2|article3)$ https://sub.example.com/$1 [R=301,L]
34
+ RewriteRule ^article4$ https://sub.example.com/article4-new/ [R=301,L]
35
+ </IfModule>
36
+ # END リダイレクト
37
+ ```
38
+ 上記のとおり、<IfModule mod_rewrite.c></IfModule>で囲う書き方もしてみましたが、変わりありませんでした。