rewritecond conditions at the same timeRewriterule the applicable identifier' Redirect| R [=code] ' (Force redirect) forced overrides to an external turn based on HTTP (note URL changes) such as: [R=301,l]' Forbidden| F ' (Force URL to is forbidden) overridden to prohibit access' Proxy| P ' (force proxy) overrides the HTTP path that is accessed through the proxy' Last| L ' (last rule) The final rewrite rule flag, if matched, no longer executes subsequent rules' Next| N ' (next round) loops the
Rewrite_module MODULES/MOD_REWRITE.SL in httpd.conf to remove the reboot service and create a new one under the entry file. htaccess.php, rewrite file is to remove the meaning of index.php:
Copy Code code as follows:
Rewriteengine on
Rewritecond%{request_filename}!-d
Rewritecond%{request_filename}!-f
Rewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]
More interested in thinkphp related content readers can view the site topics: "t
Copy Code code as follows:
http://serverName/appName/module/action/id/1/
This is PathInfo mode.
Without considering routing, the first parameter is resolved to the module name (if grouping is enabled, then recursion backwards), the second parameter is parsed into action, the subsequent argument is explicitly passed, and must be in pairs, for example:
Copy Code code as follows:
http://serverName/appName/module/action/year/2008/month/09/day/21/
The usua
Let the browser access the PHP file through the Chinese path, as shown below
Need to set URL rewrite, and use Iconv function in index.php file
Iconv ("Utf-8", "GBK", $_get["url"]);
The directory structure is as follows
In the. htaccess file Configuration
mod_rewrite.c>
+followsymlinks-multiviews
on
#RewriteCond%{ Request_filename}!-d
#RewriteCond%{request_filename}!-f
Rewriterule^ (. * (PHP) +.*) $ index.php?url=$1 [qsa,pt,l]
/$1 [qsa,pt,l]
6. Pagination in CI
The model operates
//loads the paging class file
$this->load->library (' pagination ');
$this->load->helper (URL);
Page links
$config [' base_url '] = Site_url (' user/test ');
Total number of records
$config [' total_rows '] = m;
Each page displays 10 data
$config [' per_page '] = ten;
Offset
$offset _limit = intval ($this->uri->segment (3));
$this->pagination->initialize ($config);
echo $this->pagina
/def/ghiIf the PT mark is omitted, though it will uri=/abc/... Rewrite for filename=/def/... Part works, but subsequent mod_alias will be invalidated when attempting to convert the URI to the filename.Note: If you need to mix multiple modules that convert URIs to file names, you must use this tag ... Mixing Mod_alias and mod_rewrite here is a classic example.
' Qsappend| QSA ' (append query string)This tag forces the override engine to append a query
; application/home/common/function.php
app/common/extend.php => application/home/common/extend.php (assuming existence defined)
app/conf/config.php => application/home/conf/config.php
app/lang/zh-cn/common.php => application/home/lang/zh-cn.php (if present)
App/lib/action => application/home/action
App/lib/model => Application/home/model
APP/TPL => Application/home/view
Note that because of the presence of the home directory, you need to modify your. htaccess file to
The code is as follows:
O
Tags: BSP write content root URL sharp request character appApache host general support. Htaccess pseudo-static, that can be implemented to bind the domain name to subdirectories, a space multiple sites. Application Example: Binding htaccess.800m.net to htaccess directory root directory. htaccess content Even if the "." In the Http_host It is also possible to implement binding htaccess.800m.net without backslashes, because "." Can match any one character. . htaccess content in the htaccess dire
escaped to the equivalent hexadecimal encoding ("%25′,"%24′, "%3b", etc.). This flag prevents such escapes from allowing symbols such as percent sign to appear in the output, such as: rewriterule/foo/(. *)/bar?arg=p1\%3d$1 [R,ne] allows "/foo/zed to turn to a secure request"/bar?arg=p1= Zed ". [ns]--no subrequest (Disable child request): Skips the current command if there is an internal sub-request. This token forces the rewrite engine to skip the rewrite rule when the current request is an in
a directory (-D). When both conditions are met, the last article "Rewriterule." /index.php [L] "will rewrite all requests to index.php.As we can see from here, WordPress defaults to all the URLs that do not refer to static files or directories are all rewritten to index.php, and then the request is processed uniformly by index.php.Just now we mentioned the function of [L], in fact Rewriterule also supports many other parameters, including:
R forces external redirection, which can be fo
Tags: index iter mode div rri remove one cond modeURL rewritingThe usual URL contains index.php, in order to achieve a better SEO effect may need to remove the URL inside the index.php, through the way of URL rewriting can achieve this effect, usually need to open the Server Url_rewrite module to support. The following 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
Meaning
Description
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
N
Next
Again the first rule starts processing, but uses the current rewritten URL address
C
Chain
:
RewirteRule flag
Description
Description
R
Redirect
Issue an HTTP redirect
F
Forbidden
Prohibit Access to URL addresses
G
Gone
The specified URL does not exist.
P
Proxy
Pass the URL address to mod_proxy
L
Last
Stop processing the following rules
N
Next
Processing starts from the first rule again, but uses the URL address after the current rewriting.
C
Chain
Link the current r
Recently, I have been doing the project of the Mother Regiment, because the link cannot be opened in the actual project, to add index.php to normal access by default.At that time, I forgot it was tinkphp's URL rewrite mode: After encountering the same problem, first think of URL rewrite mode.
The mod_rewrite.so module is loaded in the httpd.conf configuration file
allowoverride None Change None to all
Save the following content as a. htaccess file in the same sibling directory as the
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/73/3C/wKioL1X4KaawBZzsAABpNOI1h1o291.jpg "title=" Qq20150915221245.png "alt=" Wkiol1x4kaawbzzsaabpnoi1h1o291.jpg "/>Resolution 1:. htaccessRewriteengine onRewritecond%{request_filename}!-dRewritecond%{request_filename}!-fRewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]This article is from the "at Your Fingertips" blog, so be sure to keep this source http://liuyongjack.blog.51cto.com/7959010/16951
.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) is associated with the next lawIf the rule match is handled normally, the flag is invalid and if it does not match, all the associated rules below are skipped.8) T=mime-type (Force MIME type) enforce MIME type9) NS (used only if no internal sub-request) is only used for internal
This article describes how to modify the apache configuration file to remove index. php from thinkphpurl. For more information, see ApacheThinkPHP.
For example, your original path is http: // localhost/test/index. php/index/addThe current address is http: // localhost/test/index/addHow can I remove index. php?
1. the mod_rewrite.so module is loaded in the httpd. conf configuration file. // Configure it in APACHE. The code is as follows:# LoadModule rewrite_module modules/mod_rewrite.so remove
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.