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

質問編集履歴

3

対象ディレクトリ以下のhtaccess情報

2019/01/08 04:23

投稿

koheikameyama
koheikameyama

スコア13

title CHANGED
File without changes
body CHANGED
@@ -12,5 +12,58 @@
12
12
  その後アクセスしたところ、
13
13
  `https://****/bbbb/aaaa/○○○○~`のurlにアクセスしてしまってるようで、うまくアクセスできませんでした。
14
14
 
15
- どのようにすれば期待する事柄をじつげんできるでしょうか。
15
+ どのようにすれば期待する事柄を実現できるでしょうか。
16
- ご教授お願いします。
16
+ ご教授お願いします。
17
+
18
+ ------追記------
19
+ Document root配下 `aaaa/`の中身はcakephp2のソースが存在してます。
20
+ ```
21
+ aaaa┐
22
+ ├.htaccess ※1
23
+ ├app┐
24
+ │ └.htaccess※2
25
+
26
+ ├webroot┐
27
+ └.htaccess※3
28
+ ```
29
+
30
+ と3つhtaccessがあります。
31
+ 上記.htaccessの内容は以下です。
32
+
33
+ ```
34
+ ※1
35
+ <IfModule mod_rewrite.c>
36
+ RewriteEngine on
37
+ # Uncomment if you have a .well-known directory in the root folder, e.g. for the Let's Encrypt challenge
38
+ # https://tools.ietf.org/html/rfc5785
39
+ #RewriteRule ^(.well-known/.*)$ $1 [L]
40
+ RewriteRule ^$ app/webroot/ [L]
41
+ RewriteRule (.*) app/webroot/$1 [L]
42
+ </IfModule>
43
+ ```
44
+
45
+ ```
46
+ ※2
47
+ <IfModule mod_rewrite.c>
48
+ RewriteEngine on
49
+ # Uncomment if you have a .well-known directory in the app folder, e.g. for the Let's Encrypt challenge
50
+ # https://tools.ietf.org/html/rfc5785
51
+ #RewriteRule ^(.well-known/.*)$ $1 [L]
52
+ RewriteRule ^$ webroot/ [L]
53
+ RewriteRule (.*) webroot/$1 [L]
54
+ </IfModule>
55
+ ```
56
+
57
+ ```
58
+ ※3
59
+ <IfModule mod_rewrite.c>
60
+ RewriteEngine On
61
+ RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
62
+ RewriteCond %{REQUEST_FILENAME} !-d
63
+ RewriteCond %{REQUEST_FILENAME} !-f
64
+ RewriteRule ^ index.php [L]
65
+ </IfModule>
66
+ ```
67
+ です。
68
+
69
+ 宜しくおねがいします。

2

タグの変更

2019/01/08 04:23

投稿

koheikameyama
koheikameyama

スコア13

title CHANGED
File without changes
body CHANGED
File without changes

1

リダイレクトではなくリライトでした

2018/12/07 07:55

投稿

koheikameyama
koheikameyama

スコア13

title CHANGED
@@ -1,1 +1,1 @@
1
- htaccessでのurlリレクトがうまくいかない
1
+ htaccessでのurlリイトがうまくいかない
body CHANGED
@@ -1,6 +1,6 @@
1
1
  Amazon EC2 Ubuntu 16.04でapache2を利用してサイト作成をしています。
2
2
  ###### 実現したいこと
3
- `https://****/aaaa/○○○○~`というurlを`https://****/bbbb/○○○○~`にリダイレクトしたい。
3
+ `https://****/aaaa/○○○○~`というurlを`https://****/bbbb/○○○○~`にリライト(urlを変更せず内部的にのみリダイレクトしたい。
4
4
 
5
5
  ###### やったこと
6
6
  rootdirectory直下に.htaccessを作成し以下のように記述しました。