PHP Framework queryphp Tutorial: Getting started nine how to get rid of index.php

Source: Internet
Author: User
Tags php framework
PHP Framework queryphp Tutorial: Getting started nine how to get rid of index.php

Remove index.php Test

Add a row to the C:\WINDOWS\system32\drivers\etc\hosts file

The contents are as follows

127.0.0.1 localhost

192.168.0.10 www.tjwzjs.cn

192.168.0.10 is your own Apache use of IP, is the following

* Number in the IP, the proof can access your local network card can be

Http://www.tjwzjs.cn/queryphp/project/index.php/default/index

I want to be like this after configuration

Http://www.tjwzjs.cn/queryphp/project/default/index.html

Remember to gator a line in the inc.ini.php file

$config [' HTML ']= '. html '; or remove the front//, so you can

Virtual Host configuration test, allowoverride FileInfo will use the. htaccess configuration

The virtual host configuration test file is inside the Apache virtual host:

Order Allow,deny

Allow from all

AllowOverride FileInfo?

?

DocumentRoot "D:/work"

ServerName "Www.app.com"

The. htaccess file is placed under the project directory under each item directory, which will access the sibling directory

index.php file

The. htaccess file in the index.php directory:

Rewriteengine on

?

# Uncomment the following line, if you is having trouble

# getting No_script_name to work

#RewriteBase/

?

# We skip all files with. Something

#RewriteCond%{request_uri} \. +$

#RewriteCond%{request_uri}!\.html$

#RewriteRule. *-[L]

?

# we check if the. html version is here (caching)

Rewriterule ^$ index.html [QSA]

Rewriterule ^ ([^.] +) $ $1.html [QSA]

Rewritecond%{request_filename}!-f

?

# No, so we redirect to our front web controller

Rewriterule ^ (. *) $ index.php [qsa,l]

------------------------

Use Url_for () mode in the program

Examples shown in the template are we still using the curd method?

"> Edit

The > Delete

Downloaded after and set in Apache www.app.com in C:/windows/system

Http://www.tjwzjs.cn/queryphp/project/curd/index

Is it possible to display the content?

If shown in the framework\config\inc.ini.php file, uncomment the following line

$config [' HTML ']= '. html ';//open. HTML End URL

http://www.tjwzjs.cn/queryphp/project/curd/index.html Access

Can you see the contents?

All links are with the. HTML end. Well, sometimes we want to. What to do with HTML endings

The > Delete

Url_for (url,true); means do not end HTML

The deletion becomes such a child

Http://www.tjwzjs.cn/queryphp/project/curd/delete/id/2?


Original source: http://tjwzjs.cn/news/knowledge/2012/1210/56.html

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.