![]() |
hi there.
current theme is school. PHP Code: /* (Picture1: I can't paste a image.) `http://localhost:8080/school/` not works. but, for example ... change to `schoolx` PHP Code: /* (Picture2: I can't paste a image.) `http://localhost:8080/schoolx/` it works. why routing not work?? infomation: controller name is `School.php`
What do you mean by not works?
(01-09-2022, 03:01 AM)kenjis Wrote: What do you mean by not works? thank you kenjis. here, following picture for error. https://drive.google.com/file/d/1Tl92IK_...sp=sharing Quote:[Sun Jan 9 20:10:28 2022] PHP 8.1.1 Development Server (http://localhost:8080) started Why can't I paste images on this bulletin board? (01-09-2022, 09:20 AM)iRedds Wrote: Do you have a school directory in public? iRedds, thank you for your reply. Yes, there is a "school" directory. Look at the next image. https://drive.google.com/file/d/19Jxf0AP...sp=sharing
Well, actually this is the problem.
First, the web server looks for paths in the DOCUMENT_ROOT (public directory) and if it doesn’t find it, then it passes control to php. If you have a /public/school directory, then when you go to the address http://domain/school, the web server will try to read it. So in your case, I would recommend changing the paths. /public/assets/school /public/assets/home (01-09-2022, 07:03 PM)iRedds Wrote: Well, actually this is the problem. Thank you iRedds. I solved it by creating the 'assets' folder. Is it "codeigniter" to study this basic mechanism? Or is it "php"? I want to know why such a routing accident happened
The web server first of all looks for the directory or file specified in the URL.
By default, if a file or directory is not found, the server generates a 404 error. For software routing to work, instructions are prescribed to the web server to redirect the processing of requests to the front controller in the absence of a file or directory. Absolutely all frameworks work on this principle. (01-09-2022, 10:54 PM)iRedds Wrote: The web server first of all looks for the directory or file specified in the URL. thanks, I voted for you. |
Welcome Guest, Not a member yet? Register Sign In |