質問編集履歴
2
wordpressとfuelの\.htaccessを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -68,6 +68,121 @@
|
|
68
68
|
...
|
69
69
|
```
|
70
70
|
|
71
|
+
```bash
|
72
|
+
# /home/kusanagi/www/DocumentRoot/.htaccess
|
73
|
+
|
74
|
+
<Files ~ "^\.ht">
|
75
|
+
Deny from all
|
76
|
+
</Files>
|
77
|
+
<Files wp-login.php>
|
78
|
+
Order deny,allow
|
79
|
+
Deny from all
|
80
|
+
Allow from all
|
81
|
+
#Allow from 127.0.0.1
|
82
|
+
AuthType Basic
|
83
|
+
AuthName "ENTER YOUR NAME & PASSWORD TO LOGIN"
|
84
|
+
AuthUserFile /home/kusanagi/.htpasswd
|
85
|
+
Require valid-user
|
86
|
+
Satisfy any
|
87
|
+
</Files>
|
88
|
+
|
89
|
+
<IfModule mod_rewrite.c>
|
90
|
+
RewriteEngine On
|
91
|
+
RewriteBase /
|
92
|
+
RewriteRule ^index\.php$ - [L]
|
93
|
+
RewriteCond %{REQUEST_URI} !\.(gif|css|js|swf|jpeg|jpg|jpe|png|ico|swd|pdf|svg|eot|ttf|woff) $
|
94
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
95
|
+
RewriteCond %{REQUEST_FILENAME} !-d
|
96
|
+
RewriteRule . /index.php [L]
|
97
|
+
</IfModule>
|
98
|
+
```
|
99
|
+
|
100
|
+
```bash
|
101
|
+
# /home/kusanagi/www/admin/public/.htaccess
|
102
|
+
|
103
|
+
# Multiple Environment config, set this to development, staging or production
|
104
|
+
SetEnv FUEL_ENV development
|
105
|
+
# SetEnv FUEL_ENV production
|
106
|
+
|
107
|
+
<IfModule mod_rewrite.c>
|
108
|
+
|
109
|
+
# RewriteEngine を起動
|
110
|
+
RewriteEngine on
|
111
|
+
|
112
|
+
# NOTICE: If you get a 404 play with combinations of the following commented out lines
|
113
|
+
#AllowOverride All
|
114
|
+
#RewriteBase /wherever/fuel/is
|
115
|
+
RewriteBase /admin
|
116
|
+
|
117
|
+
# Make sure directory listing is disabled
|
118
|
+
# Options +FollowSymLinks -Indexes
|
119
|
+
|
120
|
+
# Restrict your site to only one domain
|
121
|
+
# !important USE ONLY ONE OPTION
|
122
|
+
|
123
|
+
# Option 1: To rewrite "www.domain.com -> domain.com" uncomment the following lines.
|
124
|
+
#RewriteCond %{HTTPS} !=on
|
125
|
+
#RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
|
126
|
+
#RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
|
127
|
+
|
128
|
+
# Option 2: To rewrite "domain.com -> www.domain.com" uncomment the following lines.
|
129
|
+
#RewriteCond %{HTTPS} !=on
|
130
|
+
#RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
|
131
|
+
#RewriteCond %{HTTP_HOST} (.+)$ [NC]
|
132
|
+
#RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
|
133
|
+
|
134
|
+
# Remove index.php from URL
|
135
|
+
RewriteCond %{HTTP:X-Requested-With} !^XMLHttpRequest$
|
136
|
+
RewriteCond %{THE_REQUEST} ^[^/]*/index\.php [NC]
|
137
|
+
RewriteRule ^index\.php(.*)$ $1 [R=301,NS,L]
|
138
|
+
|
139
|
+
DirectorySlash Off
|
140
|
+
|
141
|
+
RedirectMatch permanent /admin$ /admin/login
|
142
|
+
RedirectMatch permanent /admin/$ /admin/login
|
143
|
+
|
144
|
+
# make HTTP Basic Authentication work on php-fcgi installs
|
145
|
+
<IfModule mod_fcgid.c>
|
146
|
+
RewriteCond %{HTTP:Authorization} .
|
147
|
+
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
148
|
+
</IfModule>
|
149
|
+
|
150
|
+
# Send request via index.php if not a real file or directory
|
151
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
152
|
+
RewriteCond %{REQUEST_FILENAME} !-d
|
153
|
+
|
154
|
+
# deal with php-fcgi first
|
155
|
+
<IfModule mod_fcgid.c>
|
156
|
+
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
|
157
|
+
</IfModule>
|
158
|
+
|
159
|
+
# no php-fcgi, check for sapi and fpm
|
160
|
+
<IfModule !mod_fcgid.c>
|
161
|
+
|
162
|
+
# for PHP5 sapi installations
|
163
|
+
<IfModule mod_php5.c>
|
164
|
+
RewriteRule ^(.*)$ index.php/$1 [L]
|
165
|
+
</IfModule>
|
166
|
+
|
167
|
+
<IfModule !mod_php5.c>
|
168
|
+
|
169
|
+
# for PHP7 sapi installations
|
170
|
+
<IfModule mod_php7.c>
|
171
|
+
RewriteRule ^(.*)$ index.php/$1 [L]
|
172
|
+
</IfModule>
|
173
|
+
|
174
|
+
# for fpm installations
|
175
|
+
<IfModule !mod_php7.c>
|
176
|
+
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
|
177
|
+
</IfModule>
|
178
|
+
|
179
|
+
</IfModule>
|
180
|
+
|
181
|
+
</IfModule>
|
182
|
+
|
183
|
+
</IfModule>
|
184
|
+
```
|
185
|
+
|
71
186
|
###補足情報(言語/FW/ツール等のバージョンなど)
|
72
187
|
| |バージョン|
|
73
188
|
|:--|:--|
|
1
タイトルと実現したいことを更新
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
KUSANAGI で Nginx + WordPress + FuelPHP
|
1
|
+
KUSANAGI for ConoHa で Nginx + WordPress + FuelPHP を正常に動作させる
|
body
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
よろしくお願いいたします。
|
2
2
|
|
3
3
|
###前提・実現したいこと
|
4
|
-
KUSANAGI for ConoHa にて、Nginx で WordPress と FuelPHP を動かしたいです。
|
4
|
+
KUSANAGI for ConoHa にて、Nginx で WordPress と FuelPHP を以下のURLで動かしたいです。
|
5
5
|
| |URL|
|
6
6
|
|:--|:--|
|
7
7
|
|WordPress|http://example.jp|
|
8
8
|
|FuelPHP|http://example.jp/admin/{コントローラ名}|
|
9
9
|
|
10
|
+
* 通常/adminとするとwp-adminに飛ぶと思うのですが、そうせずFuelPHP側が表示されるように
|
11
|
+
|
10
12
|
```bash
|
11
13
|
# ディレクトリ
|
12
14
|
/
|