質問編集履歴
1
試したコードの一部 追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,6 +18,20 @@
|
|
18
18
|
|
19
19
|
エックスサーバー機能のサイト転送設定(Redirect permanent)や.htaccessの編集(mod_rewrite)など試しましたが、うまくいきませんでした。
|
20
20
|
|
21
|
+
以下は試したコードの一部ではありますが。こちらをpublic_html内の.htaccessに記載。
|
22
|
+
|
23
|
+
<IfModule mod_rewrite.c>
|
24
|
+
|
25
|
+
RewriteEngine On
|
26
|
+
|
27
|
+
RewriteCond %{HTTP_HOST} ^www.xxxx.com$ [OR]
|
28
|
+
|
29
|
+
RewriteCond %{HTTP_HOST} !=sub.xxxx.com$
|
30
|
+
|
31
|
+
RewriteRule /old http://xxxx.com/new [R=301,L]
|
32
|
+
|
33
|
+
</IfModule>
|
34
|
+
|
21
35
|
```
|
22
36
|
|
23
37
|
|
@@ -28,15 +42,15 @@
|
|
28
42
|
|
29
43
|
下の階層のリダイレクトがうまくいかない。
|
30
44
|
|
31
|
-
http://xxxx/old -> http://xxxx/new
|
45
|
+
http://xxxx.com/old -> http://xxxx.com/new
|
32
46
|
|
33
|
-
http://xxxx/old/old2 -> http://xxxx/new
|
47
|
+
http://xxxx.com/old/old2 -> http://xxxx.com/new
|
34
48
|
|
35
49
|
としたいが、
|
36
50
|
|
37
|
-
http://xxxx/old -> http://xxxx/new
|
51
|
+
http://xxxx.com/old -> http://xxxx.com/new
|
38
52
|
|
39
|
-
http://xxxx/old/old2 -> http://xxxx/new/old2
|
53
|
+
http://xxxx.com/old/old2 -> http://xxxx.com/new/old2
|
40
54
|
|
41
55
|
となってしまう。
|
42
56
|
|
@@ -50,9 +64,9 @@
|
|
50
64
|
|
51
65
|
サブドメインはリダイレクトさせたくないが、影響してしまう。
|
52
66
|
|
53
|
-
http://xxxx/old -> http://xxxx/new
|
67
|
+
http://xxxx.com/old -> http://xxxx.com/new
|
54
68
|
|
55
|
-
http://sub.xxxx/old -> http://xxxx/new
|
69
|
+
http://sub.xxxx.com/old -> http://xxxx.com/new
|
56
70
|
|
57
71
|
となってしまう。
|
58
72
|
|