Integrate your site entrance
Everyone may often see this path on the Internet (
Http://www.aaa.com/aaa/bbb/aaa?id=5), make people don't understand, such a website implementation has several possibilities:
1. The extension of the hidden file is the benefits of this practice, and there is no need for personal feelings.
2. Use the redirection rules of the website to realize the virtual path;
3. Improve the virtual path in the way for mandatory file parsing.
Use the second third method to realize the unified interface of the website, a reasonable integrated website, better refer to the security and architecture of the website, most of the two ways of the website is built and implemented using the "MVC" mode.
Below is an example
The access path is as follows:
... / TEST / ******* / BAD ... / TEST / ******* / Good ("******" can be used Character string replace, "......." is your web path)
The directory structure of the file is as follows
| -. HTACCESS | - TEST | - Application.php | - Controler / GoodControl.php | - Controler / BadControl.php
Note that the file ".htaccess", can be created directly under Windows, can be created in command line mode.
File 0 (.htaccess) (this file is used to change the Apache configuration)
Document 1 (Test.php)
php / * ----------------------------------- * Test.php * * as you Site entrance file * Used to initialize and entry * call to perform Controler call * ---------------------------------------------------------------------------------------------- ----- * / Require "Application.php"; $ AA = New Application (); $ aa-> parse (); $ aa-> go ();?>>
File 2 (GoodControlr.php)
php / * ----------------------------------- * GoodControlr.php * * is used Control URL = / test / good access * ------------------------------------- * / Class GoodController {/ * * Control Class Call Method, Unique External Interface * / Function Control () {Echo "this is from goodControl URL = ********* / test / good"; }}?>
File 3 (BadControlr.php)
php / * ----------------------------------- * BadControlr.php * * is used Control URL = / Test / Bad access * ------------------------------------- * / Class BadControler {/ * * Control Class Call Method, Unique External Interface * / Function Control () {Echo "this is from goodControl URL = ********* / test / bad" }}?>
Document 4 (Application.php)