Introduction: This is a detailed page for removing index. php from the codeigniter address. It introduces PHP, related knowledge, skills, experience, and some PHP source code.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 329785 'rolling = 'no'>
Version: codeigniter_2.0.1
The URL of the Ci application does not contain index. php.
Example: http://www.example.com/index.php/product/712
Http://www.example.com/product/712 like this
In this way, the URL is more beautiful, and Seo may be more friendly, which can be implemented through urlrewrite.
You only need to perform the following three steps:
1. Create an. htaccess write rewrite rule as follows:
[Code]
<Ifmodule mod_rewrite.c>
Rewriteengine on
Rewritebase/
# Removes access to the system folder by users.
# Additionally this will allow you to create a system. php controller,
# Previusly this wocould not have been possible.
# 'System' can be replaced if you have renamed your system folder.
Rewritecond % {request_uri} ^ system .*
Rewriterule ^ (. *) $/index. php? /$1 [l]
# When your application folder isn' t in the system folder
# This snippet prevents user access to the application folder
# Submitted by: fabdrol
# Rename 'application' to your Applications folder name.
Rewritecond % {request_uri} ^ application .*
Rewriterule ^ (. *) $/index. php? /$1 [l]
# Checks to see if the user is attempting to access a valid file,
# Such as an image or CSS document, if this Isn't true it sends
# Request to index. php
Rewritecond % {request_filename }! -F
Rewritecond % {request_filename }! -D
Rewriterule ^ (. *) $ index. php? /$1 [l]
</Ifmodule>
<Ifmodule! Mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# Can be sent to index. php, And everything works as normal.
# Submitted by: elliothaughin
Errordocument 404/index. php
</Ifmodule>
[/Code]
2. Set $ config ['index _ page'] To empty
Open the file system/application/config. phpCode
[PHP] $ config ['index _ page'] = "index. php"; [/PHP]
Change
[PHP] $ config ['index _ page'] = ''; [/PHP]
3. Make sure Apache supports URL rewriting and restart Apache.
More articles about "Remove index. php from codeigniter address"
Love J2EE follow Java Michael Jackson video station JSON online tools
Http://biancheng.dnbcw.info/php/329785.html pageno: 12.