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

回答編集履歴

2

修正

2020/06/01 20:35

投稿

退会済みユーザー
answer CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  `http://hogehoge.com/top/index`へのアクセスを、`app/application/index.php`またはその先で、`http://hogehoge.com`へリダイレクトさせてあげると良いです。
19
19
 
20
- 例C)「http://hogehoge.com」にアクセスした場合
20
+ > 例C)「http://hogehoge.com」にアクセスした場合
21
21
  ①app/application/index.phpの処理を実行する。
22
22
  ②$_GET['url']の内容:'top/index'
23
23
  ③app/application/index.phpの処理で、app/application/controllers/top.phpのindex()関数を実行する。

1

追記

2020/06/01 20:35

投稿

退会済みユーザー
answer CHANGED
@@ -1,1 +1,27 @@
1
- `app/application/index.php`に意図した処理を記述するだけかと。
1
+ `app/application/index.php`に意図した処理を記述するだけかと。
2
+
3
+ **追記**
4
+ > 例A)「http://hogehoge.com/bbb/index」にアクセスした場合
5
+ ①app/application/index.phpの処理を実行する。
6
+ ②$_GET['url']の内容:'bbb/index'
7
+ ③app/application/index.phpの処理で、app/application/controllers/bbb.phpのindex()関数を実行する。
8
+ ④表示URLが「http://hogehoge.com/bbb/index」
9
+
10
+ 色々気になる点はありますが、仕様を満たしていると判断されている かつ 本質問から離れるため言及しません。
11
+
12
+ > 例B)「http://hogehoge.com/top/index」にアクセスした場合
13
+ ①app/application/index.phpの処理を実行する。
14
+ ②$_GET['url']の内容:'top/index'
15
+ ③app/application/index.phpの処理で、app/application/controllers/top.phpのindex()関数を実行する。
16
+ ④表示URLが「http://hogehoge.com」
17
+
18
+ `http://hogehoge.com/top/index`へのアクセスを、`app/application/index.php`またはその先で、`http://hogehoge.com`へリダイレクトさせてあげると良いです。
19
+
20
+ 例C)「http://hogehoge.com」にアクセスした場合
21
+ ①app/application/index.phpの処理を実行する。
22
+ ②$_GET['url']の内容:'top/index'
23
+ ③app/application/index.phpの処理で、app/application/controllers/top.phpのindex()関数を実行する。
24
+ ④表示URLが「http://hogehoge.com」
25
+
26
+ `.htaccess`へ`http://hogehoge.com`へアクセスが有った場合の処理を記述する必要があります。
27
+ `app/application/index.php`にも処理を記述する必要です。その際、ループしないように注意してください。