質問編集履歴
3
問題となっている「.htacces」のパスを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -66,9 +66,11 @@
|
|
66
66
|
|
67
67
|
┣index.html
|
68
68
|
|
69
|
+
┣.htaccess
|
69
70
|
|
70
71
|
|
72
|
+
|
71
|
-
■.htaccesコード
|
73
|
+
■「web_site/.htaccess」の.htaccesコード
|
72
74
|
|
73
75
|
```ここに言語を入力
|
74
76
|
|
2
htacces 記述修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -72,7 +72,7 @@
|
|
72
72
|
|
73
73
|
```ここに言語を入力
|
74
74
|
|
75
|
-
RewriteCond %{HTTP_HOST} !^
|
75
|
+
RewriteCond %{HTTP_HOST} !^example. [NC]
|
76
76
|
|
77
77
|
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
|
78
78
|
|
1
.htaccesのリンクを変更と、リダイレクトしてしまうURLの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -9,6 +9,16 @@
|
|
9
9
|
下記のディレクトリ構造の「page-contact.php」をwordpressの固定ページで出しています。
|
10
10
|
|
11
11
|
静的なページは問題なく、リダイレクトが効いているのですが、wordpressの固定ページを表示するとリダイレクトが効いてしまい表示がされないので、WPのディレクトリの中身をリダイレクト無効にする方法はありますか?わかる方がいましたら教えてほしいです。
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
■追記
|
16
|
+
|
17
|
+
問題となっているリダイレクトしてしまうURL
|
18
|
+
|
19
|
+
https://example.com/contact/
|
20
|
+
|
21
|
+
|
12
22
|
|
13
23
|
|
14
24
|
|
@@ -64,13 +74,13 @@
|
|
64
74
|
|
65
75
|
RewriteCond %{HTTP_HOST} !^web_site. [NC]
|
66
76
|
|
67
|
-
RewriteRule ^(.*)$ https://
|
77
|
+
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
|
68
78
|
|
69
79
|
# 末尾/を除外しリダイレクト
|
70
80
|
|
71
81
|
RewriteCond %{REQUEST_FILENAME} -f
|
72
82
|
|
73
|
-
RewriteRule ^(.*)/+$ https://
|
83
|
+
RewriteRule ^(.*)/+$ https://example.com/$1 [R=301,L]
|
74
84
|
|
75
85
|
# 存在しないディレクトリは上位へリダイレクト
|
76
86
|
|
@@ -78,13 +88,13 @@
|
|
78
88
|
|
79
89
|
RewriteCond %{REQUEST_FILENAME}/ en/
|
80
90
|
|
81
|
-
RewriteRule ^(.*)/+$ https://
|
91
|
+
RewriteRule ^(.*)/+$ https://example.com/$1 [R=301,L]
|
82
92
|
|
83
93
|
# 存在しないディレクトリはTOPへリダイレクト
|
84
94
|
|
85
95
|
RewriteCond %{REQUEST_FILENAME}/ !-d
|
86
96
|
|
87
|
-
RewriteRule ^(.*)/+$ https://
|
97
|
+
RewriteRule ^(.*)/+$ https://example.com/$1 [R=404,L]
|
88
98
|
|
89
99
|
# index.html除外へ正規化
|
90
100
|
|
@@ -92,9 +102,9 @@
|
|
92
102
|
|
93
103
|
RewriteCond %{REQUEST_URI} ^.*index$ [NC]
|
94
104
|
|
95
|
-
RewriteRule ^(.*)index.html/$ https://
|
105
|
+
RewriteRule ^(.*)index.html/$ https://example.com/$1 [R=301,L]
|
96
106
|
|
97
|
-
RewriteRule ^(.*)index.*$ https://
|
107
|
+
RewriteRule ^(.*)index.*$ https://example.com/$1 [R=301,L]
|
98
108
|
|
99
109
|
# 存在しないページは上位階層へリダイレクト
|
100
110
|
|
@@ -102,13 +112,13 @@
|
|
102
112
|
|
103
113
|
RewriteCond %{REQUEST_FILENAME} !-f
|
104
114
|
|
105
|
-
RewriteRule (.*)/(.*) https://
|
115
|
+
RewriteRule (.*)/(.*) https://example.com/$1/ [R=301,L]
|
106
116
|
|
107
117
|
# httpsへ正規化
|
108
118
|
|
109
119
|
RewriteCond %{ENV:HTTPS} !^on$ [NC]
|
110
120
|
|
111
|
-
RewriteRule ^(.*)$ https://
|
121
|
+
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
|
112
122
|
|
113
123
|
DirectoryIndex index.html
|
114
124
|
|