CakePHP3です。
http://example.com/test/example.xml
というふうにxmlを配置したいです。
http://example.com/test
はHogeController
のindex()
アクションです。
/test
はプレフィックスルーティングです。
webroot
ディレクトリに
. ∟test
. ∟example.xml
という構造で配置したところ、http://example.com/test
のURLでアクセスしたときにcakeのファイルではなく、
webrootに配置したディレクトリを読みに行ってしまい、403のエラーになってしまいます。
上記を実現させようとするならどのようにすればよいのでしょうか?
どこをいじればいいのかも分からないので、ご教授頂けると幸いです。
何卒よろしくお願い致します。
##追記
ご指摘いただきました点について下記の情報を追記します。
ルーティングについては下記のように設定しています。
php
1Router::prefix('test', function ($routes) { 2 $routes->fallbacks(DashedRoute::class); 3 $routes->connect('/', ['controller' => 'Hoge', 'action' => 'index']); 4 $routes->connect('/foo', ['controller' => 'Foo', 'action' => 'index']); 5: 6: 7}
使用しているのはNginxです。
location / { root /path/to/cakephp/webroot; index index.php index.html index.htm; try_files $uri $uri/ /index.php?$args; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
回答1件
あなたの回答
tips
プレビュー