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

質問編集履歴

5

誤字の修正

2021/10/10 22:34

投稿

pqpq
pqpq

スコア0

title CHANGED
File without changes
body CHANGED
@@ -24,8 +24,7 @@
24
24
  RewriteEngine On
25
25
  RewriteCond %{REQUEST_URI} !^/dev/
26
26
  RewriteBase /sub1
27
- RewriteRule ^(.*)$ sub1/$1
27
+ RewriteRule ^(.*)$ sub1/$1 [L]
28
- RewriteRule ^index.php$ - [L]
29
28
  </IfModule>
30
29
  <IfModule mod_rewrite.c>
31
30
  RewriteEngine On

4

追加

2021/10/10 22:34

投稿

pqpq
pqpq

スコア0

title CHANGED
File without changes
body CHANGED
@@ -17,17 +17,27 @@
17
17
 
18
18
  ### 試したこと
19
19
 
20
- 以下で試したところ動きませんでした。
20
+ 以下で試したところ
21
- https://example.com でアクセスすると、~/public_html/example.com/のWPが動作してるようです。
22
21
 
23
22
  ```ここに言語名を入力
24
- <IfModule mod_rewrite.c>
23
+ <IfModule mod_rewrite.c>
25
24
  RewriteEngine On
25
+ RewriteCond %{REQUEST_URI} !^/dev/
26
26
  RewriteBase /sub1
27
+ RewriteRule ^(.*)$ sub1/$1
27
- RewriteRule ^sub1/index.php$ - [L]
28
+ RewriteRule ^index.php$ - [L]
29
+ </IfModule>
30
+ <IfModule mod_rewrite.c>
31
+ RewriteEngine On
32
+ RewriteCond %{REQUEST_URI} ^/dev/
33
+ RewriteBase /
34
+ RewriteRule ^/dev/(.*)$ $1
35
+ RewriteRule ^index.php$ - [L]
28
36
  RewriteCond %{REQUEST_FILENAME} !-f
29
37
  RewriteCond %{REQUEST_FILENAME} !-d
30
- RewriteRule . /sub1/index.php [L]
38
+ RewriteRule . index.php [L]
31
39
  </IfModule>
32
-
33
- ```
40
+ ```
41
+ https://example.com/ で ~/public_html/example.com/sub1 ‥‥ OK
42
+ https://example.com/dev で ~/public_html/example.com/sub1 のWPでPage Not Found (Page /dev がない) ‥‥ NG
43
+ となってうまくいきません。

3

誤字の修正

2021/10/10 12:02

投稿

pqpq
pqpq

スコア0

title CHANGED
File without changes
body CHANGED
@@ -13,7 +13,7 @@
13
13
  https://example.com/sub2 ~/public_html/example.com/sub1/sub2
14
14
  https://example.com/dev ~/public_html/example.com/
15
15
 
16
- どう記述して良いのかわかりません。どうすれば良いでしょうか?
16
+ この場合、.htaccess をどう記述すれば良いでしょうか?
17
17
 
18
18
  ### 試したこと
19
19
 

2

誤字の修正

2021/10/10 04:53

投稿

pqpq
pqpq

スコア0

title CHANGED
File without changes
body CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  環境はレンタルサーバー(Conoha Wing)です。
4
4
  レンタルサーバーの実際のフォルダでWordPress(WP)がインストールされており以下のとおりです。
5
- ~/public_html/example.com/ <- https://example.com のドキュメントルートWPがインストール
5
+ ~/public_html/example.com/ <- https://example.com のドキュメントルートWPがインストール
6
6
  ~/public_html/example.com/sub1 <- WPがインストール
7
7
  ~/public_html/example.com/sub1/sub2 <- WPがインストール
8
8
 

1

誤字の修正

2021/10/10 04:34

投稿

pqpq
pqpq

スコア0

title CHANGED
File without changes
body CHANGED
@@ -24,7 +24,7 @@
24
24
  <IfModule mod_rewrite.c>
25
25
  RewriteEngine On
26
26
  RewriteBase /sub1
27
- RewriteRule ^sub/index.php$ - [L]
27
+ RewriteRule ^sub1/index.php$ - [L]
28
28
  RewriteCond %{REQUEST_FILENAME} !-f
29
29
  RewriteCond %{REQUEST_FILENAME} !-d
30
30
  RewriteRule . /sub1/index.php [L]