Copy Code code as follows:
http://serverName/appName/module/action/id/1/
This is PathInfo mode.
Without considering routing, the first parameter is resolved to the module name (if grouping is enabled, then recursion backwards), the second parameter is parsed into action, the subsequent argument is explicitly passed, and must be in pairs, for example:
Copy Code code as follows:
http://serverName/appName/module/action/year/2008/month/09/day/21/
The usual URL contains index.php, in order to achieve better SEO effect may need to remove the URL inside the index.php, through the way of URL rewriting can achieve this effect, usually requires the server to open Url_rewrite module to support.
Here is the Apache configuration process, you can refer to the following:
1, httpd.conf configuration file loaded with mod_rewrite.so module
2, allowoverride none change none to all
3, make sure Url_model set to 2
4. Save the following content as a. htaccess file in the same sibling directory as the entry file
Copy Code code as follows:
<ifmodule mod_rewrite.c>
Rewriteengine on
Rewritecond%{request_filename}!-d
Rewritecond%{request_filename}!-f
Rewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]
</IfModule>
For the beginning has not been contacted. htacces file can be a few Baidu, here to remind you, save the filename is. htaccess, may seem to have only suffix, that is, do not add a ***.htaccess in front.
After restarting Apache, the original
Http://serverName/index.php/Blog/read/id/1
You can access it by accessing
Http://serverName/Blog/read/id/1
simplifies the URL address