$_SERVER holds the PATH_INFO if you’re using that (see Apache’s AcceptPathInfo directive). $_SERVER holds the requested URL path and query (you can parse that with parse_url), and.In PHP, all required information are in the $_SERVER variable: Because your PHP application should know best how to handle a requested URL. And I would rather suggest to do that with PHP than with web server utilities. So at some point you need to configure your web server.īut after that, when the request was passed to your PHP script, you sure can use just PHP to establish clean URLs. And if the file was not found, well, it responds with the status code 404. If a corresponding file was found, either the file’s content is passed back to the client or – as in case of PHP files – the file’s content is passed to an appropriate interpreter and the returned data is passed back to the client. Otherwise you will probably just get a 404 response.īecause the default behavior of a web server is to just take the requested URL path and try to map it to an existing file below the document root. Berikut penjelasannya: 1. The web server needs to know how to handle requests and what requests are meant to be passed to your PHP script. Di tulisan ini saya akan berbagi cara membuat Base URL yang bersih dan dinamis pada CodeIgniter 3.X. First of all: It is not possible with PHP only (at least not the forms of URL I think of when reading clean URL).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |