0 0 0 0

Create. Htaccess files in the current directory of the entry file index. Php.
( ps: how to create a search for yourself, I'm going to copy it directly )

Then put in the following code;

RewriteEngineOnRewriteCond%{REQUEST_FILENAME}!-fRewriteCond%{REQUEST_FILENAME}!-dRewriteRule ^(.*)$ index.php/$1 [L]

After that, like this:

Restart the apache and try the road by not joining index. Php to ask for access.
Example: http://adi. Dev/index. php/show/index. Html.
: http://adi. dev/show/index. Html Choreographer if you can access it properly.
The code is to use apache 's path to remove index. Php from the rewrite.
【 uses this approach, first to verify that apache is open mod 】.
It's the relevant information in the ci framework manual.

The meaning of the htaccess file code:

It's like the if statement in our program, which indicates that if a certain or some conditions are met, the following rewriterule statements are executed, which is the most primitive.

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^Mozilla//5/.0.*
RewriteRule index.php index.m.phpRewriteCond %{HTTP_USER_AGENT} ^Lynx.*
RewriteRule index.php index.L.php 
RewriteRule index.php index.b.php

It's the purpose of the above statement when you're accessing index. Php with ff browsers, you'll be asked to get your access to the index. M. Php file automatically when you're accessed with a few mobile terminals. Access to the file is actually index. L. Php if you're accessing the l. Php when you're accessed with another browser. In an image, the above statement is equivalent to the following statement in the program ( as an example of a php statement ):

if($_SERVER['HTTP_USER_AGENT'] == 'Mozilla/5.0')
{//跳转到对index.m.php的访问}elseif($_SERVER['HTTP_USER_AGENT'] == 'Lynx')

Original source: http://www. Jb51. net/article/39298. Htm.
( ps: there are two examples in which you can see )

Copyright © 2011 Dowemo All rights reserved.    Creative Commons   AboutUs