I want index.php in the directory by controller

Asked 2 years ago, Updated 2 years ago, 148 views

I am currently running the site using fuelphp.
Due to various reasons, index.php cannot be placed directly under public.
We place index.php in the subfolder and operate it.

public_html
  |_____quiry
       |________index.php
              .htaccess

In this state, I would like to place the program in a different folder.
I set index.php in the subfolder in the same way.

public_html
  |_______ function
       |________index.php
              .htaccess

Default controller is routes.php and index and
http://example/quiry has access to
If so, there is no problem, but http://example/function
If you access it, it will transition to the http://example/quiry screen.

For url access of http://example/function/function,
Transition to the intended controller, but it looks url-like
The condition is not good.
If you know how to deal with these situations, please let me know.

php fuelphp

2022-09-30 16:02

1 Answers

I don't know what the definition of routes.php is, so I would like to confirm it.

Access http://example/quiry (real file is public_html/inquiry/index.php) to
The action_index method of /fuel/app/classes/controller/index.php is executed and

Access http://example/function (real file is public_html/function/index.php) to
Do you want the action_index method of /fuel/app/classes/controller/function.php to be executed?

I don't think it's necessary to distinguish between the front controllers if it's separated by the controllers under /fuel/app/classes/controller/, but if for some reason you need to separate the front controllers, you need to define routing per front controller.
I think the following sites will be helpful.

Commonize FuelPHP resources to build multiple sites
http://qiita.com/yugokitajima/items/b3dc6b145fc933f53677

It's aggressive, but
to routes.php 'function' = > 'function/index',
You can define it as , but it also affects the query side.


2022-09-30 16:02

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.