ThinkPHP is a free, open-source, fast, and Simple Object-oriented lightweight PHP development framework. it complies with the Apache2 open-source protocol and is born for Agile WEB application development and simplified enterprise application development. During use, we often need to remove index. ph ThinkPHP from the URL path.
The result I want is nothing more than removing index. php from the URL path.
First, configure. htaccess
RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewrite
) if G forces the URL to be GONE, the response HTTP status code is returned.4) P enforces proxy forwarding.5) L indicates that the current rule is the last rule, and the rule is overwritten after analysis is stopped.6) N re-run the rewrite process from the first rule.7) C. associate with the next rule If the rule matches, it is processed normally. the following modifier is invalid. 8) T = MIME-type (force MIME type) force MIME type9) NS is only used for non-internal subrequests10) the NC is case
associated rules below will be skipped. 8) T = MIME-type (force MIME type) force MIME type 9) NS (used only if no internal sub-request) is only used for 10 instead of internal sub-requests) NC (no case) case-insensitive 11) QSA (query string append) append request string 12) NE (no URI escaping of output) does not escape special characters in the output, for example: rewriteRule/foo /(. *)/bar? Arg = P1 % 3d $1 [R, NE] will be able to correctly conve
field .html can jump to the test. php regex matching field stored in virtual memory matching $1
3. mod_rewrite rule modifier 1) R forces external redirection2) F disables the URL and returns the 403HTTP status code.3) if G forces the URL to be GONE, the response HTTP status code is returned.4) P enforces proxy forwarding.5) L indicates that the current rule is the last rule, and the rule is overwritten after analysis is stopped.6) N re-run the rewrite process from the first rule.7) C. associate
project for scaling images. Of course you can use GD2 or imagemagick (magickwand) to do the same thing, but phpThumb is dedicated to doing this. It is quite simple to use:
If the traffic volume is large, it will be unable to support it, because apache needs to call PHP for every image request to parse the phpThumb code. Although phpThumb has its own cache, it still needs to call PHP to determine whether to read from the cache.
I once saw someone using mod_rewrite to redirect a nonexistent ima
= login is better.
Index. php
The portal is not determined by ThinkPHP. what is the name of your portal file,The front-end usually uses index. php and admin. php.Note: generally, index. php index.html index. aspx index. jsp default. aspx is used by default on web servers.If no file is specified, for example, http: // localhost, the default file order set by the web server is found one by one. If no file is found, the system displays the list if the display directory is enabled.The default fi
There is a problem with the htaccess rule. Can someone help me change index. php? Year2004amp;month1convert to this example 20041.html ------ solution -------------------- PHPcodeRewriteRule ([0-9] {4}) ([0-9] * ).html $ index. php? Year $1 amp; month $2 [there is a problem with the htaccess rule. please change it.
Index. php? Year = 2004 month = 1
Convert
20041. html
------ Solution --------------------
PHP code
RewriteRule ([0-9] {4}) ([0-9] *) \. html $ index. php? Year = $1
jump to the test. php RegEx matching field stored in virtual memory matching $1
3. mod_rewrite rule Modifier 1) R forces external redirection2) F disables the URL and returns the 403HTTP status code.3) If G forces the URL to be GONE, the response HTTP status code is returned.4) P enforces proxy forwarding.5) L indicates that the current rule is the last rule, and the rule is overwritten after analysis is stopped.6) N re-run the rewrite process from the first rule.7) C. associate with the next
code.3) If G forces the URL to be GONE, the response HTTP status code is returned.4) P enforces proxy forwarding.5) L indicates that the current rule is the last rule, and the rule is overwritten after analysis is stopped.6) N re-run the rewrite process from the first rule.7) C. associate with the next ruleIf the rule matches, it is processed normally. The following modifier is invalid.8) T = MIME-type (force MIME type) force MIME type9) NS is only used for non-Internal subrequests10) the NC is
returns a 403HTTP status code. 3) If G forces the URL to be GONE, the response HTTP status code is returned. 4) P enforces proxy forwarding. 5) L indicates that the current rule is the last rule, and the rule is overwritten after analysis is stopped. 6) N re-run the rewrite process from the first rule. 7) C. associate with the next ruleIf the rule matches, it is processed normally. The following modifier is invalid.8) T = MIME-type (force MIME type) force MIME type 9) NS is only used for intern
Http://localhost/workSpace/First/index.php/Home/Index/indexHide the index.php method in the above URL as follows:The first step, delete the # number before the line ends with mod_rewrite.so in the Apache configuration file (httpd.conf)Second, create a new. htaccess file under the index.php file sibling directoryThe contents of the file are as follows:Rewriteengine onRewritecond%{request_filename}!-fRewritecond%{request_filename}!-dRewriterule ^ (. *) $ index.php/$1 [
is the Apache configuration process, you can refer to the following:1. The mod_rewrite.so module is loaded in the httpd.conf configuration file2. AllowOverride None Change None to all3. Make sure Url_model is set to 2 (this step is omitted)4. Save the following content as a. htaccess file in a sibling directory of the portal fileRewriteengine onRewritecond%{request_filename}!-dRewritecond%{request_filename}!-fRewriterule ^ (. *) $ index.php/$1 [qsa,p
specified, the default 302 HTTP status code is used.2) F (force URL to is forbidden) disables the URL and returns the 403HTTP status code.3) G (force URL to is gone) forces the URL to gone and returns the 410HTTP status code.4) P (force proxy) enforces the use of proxy forwarding.5) L (last rule) indicates that the current rule is the final rule, stopping the rewrite of the rule after parsing.6) N (next round) re-run the rewrite process starting with the first rule.7) C (chained with next rule)
ThinkPHP is a free, open-source, fast, and simple object-oriented lightweight PHP development framework. It complies with the Apache2 open-source Protocol and is born for agile WEB application development and simplified enterprise application development. In use
ThinkPHP is a free, open-source, fast, and simple object-oriented lightweight PHP development framework. It complies with the Apache2 open-source Protocol and is born for agile WEB application development and simplified enterprise applic
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.