Always want to write a frame of their own, but do not know where to start, but also used composer to build their own framework, feeling that the foundation is not too good, has been dependent on a variety of libraries and plug-ins, the framework is written to feel is a collection of class libraries,Now the framework of the company is to imitate the CI framework, the CI framework is known as the most elegant PHP framework, starting from the source of reading a step-by-step implementation of my fr
Problem Description: When using the CodeIgniter framework to do the project, when the rewrite pseudo-static function is enabled, the homepage can be accessed, but when accessing other pages, it prompts: "No input file specified."The reason is that the PHP5.6 used is fast_cgi mode, and in some cases, errors caused by PATH_INFO are not recognized correctlyThe default. Htaccess rules:Ifmodule mod_rewrite.c> Options +followsymlinks rewriteengine on rewritecond%{request_filename}!-d Rewritecond%{
Most virtual hosts cannot modify the root directory of a Web site. Can be achieved through. htaccess. Apache host general support. Htaccess pseudo-static, that can be implemented to bind the domain name to subdirectories, a space multiple sites.Application Example: Binding www.xxx.com to htaccess directoryroot directory. htaccess content/# binding www.xxx.com to subdirectories htaccessrewritecond%{http_host} ^ %{request_uri}!^/htaccess/^ (. *) $ htaccess/$1? Rewrite [L,
List of flags for Apache mod_rewrite rules rewriting
R[=code] (Force redirect) force external redirection
Forces a URL to be redirected to an external string, plus the http://thishost[:thisport]/prefix. If code is not specified, the default 302 HTTP status code is used.
F (force URL to is forbidden) disables the URL and returns a 403HTTP status code.
G (force URL to is gone) forces the URL to gone and returns a 410HTTP status code.
P (force proxy) forces the use of proxy forwarding.
L (last rul
Label:With frameworks such as thinkphp and Laravel, you know that all requests need to go through the index.php file entry, regardless of your URI. Of course, except that the files that are accessed by static files or access paths are real, such as when you visit xxx.com/home/page.html First, the Web server first go to the directory to find the home folder under the page.html, if there is access to this file, if it does not exist, re-url, into the index.php big entrance Of course, all of this is
rules for learning more. Rewriteengine onRewritecond%{request_filename}!-dRewritecond%{request_filename}!-fRewriterule ^ (. *) $ index.php/$1 [qsa,pt,l] What is the. htaccess? The. htaccess file (or "Distributed Profile") provides a way to configure a directory change by placing a file containing one or more directives in a particular document directory to act on this directory and all its subdirectories. As a user, the commands you can use are limi
requests to baz.foo ) while maintaining baz.foo/css/style.css and the Like. Get access to the original path from the PATH_INFO environment variable, as exposed to your scripting environment.Rewriteengine onrewriterule ^$ index.fcgi/[Qsa,l]rewritecond%{request_filename}!-frewritecond%{REQUEST_FILENAME}! -drewriterule ^ (. *) $ index.fcgi/$1 [qsa,l]This was a less efficient version of the Fallbackresource di
and use it later. "Two" in fact, I want the effect is like his personal site as http://www.wangkongming.cn/category/poetry/link to the address so display//redirect link without suffixrewriterule ^ (blog) ([\w/]*) \. ([a-za-z]+) $/$1$2 [r=302] () parentheses correspond to the contents of the $ 302 Temporary redirection 301 Permanent Redirection /$1$2 This/can remove the system added to the link on the address ... That's probably what it means.The effect of the above sentence is:http://www.wang
Write
explain
R[=code]
redirect
Force external redirection
F
Forbidden
Disables the URL and returns the 403HTTP status code.
G
Gone
Force URL to obsolete
P
Proxy
Force the use of proxy forwarding.
L
Last
Indicates that the current rule is the last rule, stopping the rewrite of the rule after parsing.
N
Next
Re-run the rewrite process startin
Flags is an optional parameter that is separated by commas when multiple flags appear at the same time.Quick Check Table:
Rewirterule Mark
Meaning
Describe
R
Redirect
Issue an HTTP redirect
F
Forbidden
Disallow access to URL addresses
G
Gone
Tag URL address does not exist
P
Proxy
Pass the URL address to Mod_proxy
L
Last
Stop processing the next rule
-access.log" common Options Indexes followsymlinks Includes execcgiRequire all granted Rewriteengine onRewriterule ^$ public/[L]Rewriterule (. *) public/$1 [L] Rewriteengine onRewritecond%{request_filename}!-dRewritecond%{request_filename}!-fRewriterule ^ (. *) $ index.php?_url=/$1 [qsa,l]
Perhaps different people's directory directory configuration is not the same, the general system default is placed under the D:\xampp\htdocs, but in orde
1. TP Item index.php Sibling directory Add. htaccess file, Rewirte rewrite content as:Options +followsymlinksRewriteengine onRewritecond%{request_filename}!-dRewritecond%{request_filename}!-fRewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]2. Apache in httpd.confLoadModule Rewrite_module modules/mod_rewrite.soConfigure the virtual host on the last side of the filedocumentroot/var/www/html/ServerName www.xxx.comServeralias xxx.comOptions +indexes +followsy
It's useful, mark.The. htaccess revision under public is changed toOptions +followsymlinks-multiviewsRewriteengine onRewritecond%{request_filename}!-dRewritecond%{request_filename}!-fRewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]//This line is removed and replaced by the following sentenceRewriterule ^ (. *) $ index.php [l,e=path_info:$1]//write this sentenceTP5 redirect Missing index.php error (No input file specified)
]Rewriterule (. *) public/$1 [L]The contents of the. htaccess file for the public directoryOptions-multiviewsRewriteengine onOptions-indexesRewritecond%{request_filename}!-dRewritecond%{request_filename}!-fRewritecond%{request_filename}!-lRewriterule ^ (. *) $ index.php?url=$1 [qsa,l]ErrorDocument 404 index.phpThe index.php file in the public directory is the single entry file for our website.-----------------------------------------------------------
When running to find that switching to more than 5.5 version will prompt no input file specified, nothing else but switching to 5.5 and below 5.5 is not a problem, because the need to modify the. htcaess fileModify the following:Rewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]Modified intoRewriterule ^ (. *) $ index.php [l,e=path_info:$1]Only modify this sentence, after the modification, restart the next Apache and then visit it.For thinkphp5.0 above ver
Find the httpd.conf file in your Apache installation folder confSearch LoadModule Rewrite_module modules/mod_rewrite.so If there is an annotation symbol on the front, remove it.Search for the options followsymlinks and then modify the allowoverride None below it to allowoverride all;
"1"
Did not expect to meet the no input file specified because the project used the URL route, guessed that may be rewrite problem.Record the solution.1. Check whether Doc_root set this value2. To check the. hta f
.
rewrite in the redirect. Question mark Parameter Problem
Rewrite the previous argument. You can't send it, you need to deal with it.
Will
Http://www.boshilian.com/api?t=2323v=23232nond=323we
Rewrite is:
Http://www.sina.com.cn?t=2323v=23232nod=323we
The configuration is written as follows: (URL does not change)
Rewritecond%{query_string} ^t/= (. +)? $ [NC]Rewriterule ^/api$ http://www.sina.com.cn?t=%1 [P]
or (URL change)
Rewritecond%{query_string} ^t/= (. +)? $ [NC]Rewriterule ^/api$ http
We often see large web sites that support comma-delimited css,js loading, such as:
The following solutions are shown:
1, modify Apache configuration file httpd.conf and restart, such as the following established s.juancdn.com binding and support rewrite
DocumentRoot "D:/wamp/www/static"ServerName s.juancdn.comAllowOverride AllOrder Allow,denyAllow from all
2, root directory Add. htaccess
Rewriteengine onRewritecond%{request_filename}!-fRewritecond%{query_string} ^ (. +) $Rewriterule ^ (. *)/
First, complete the routing class
1 Create a folder for other classes to store the classes we created and then modify the path that called the class
2 when our URL is Www.xxx.com/index/index we want to change his access path to the index controller and the index method, we actually visit the Www.xxx.com/index.php/index/index
3 First we want to hide index.php, get the parameter part of the path to return the corresponding controller and method name
4 we want to create a. htaccess file in the root
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.