什么$ 1 [QSA,L]意味着我的.htaccess文件? [英] What does $1 [QSA,L] mean in my .htaccess file?

查看:385
本文介绍了什么$ 1 [QSA,L]意味着我的.htaccess文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要改变我的的.htaccess 和有我不明白两行。

I need to change my .htaccess and there are two lines which I don't understand.

RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

当我应该用这些行?

推荐答案

不是地方给一个完整的教程,但在这里它是在短;

Not the place to give a complete tutorial, but here it is in short;

的RewriteCond 基本上意味着执行下一个重写规则仅如果这是真的。该! - →路径是,条件是要求不是一个链接( 表示没有,<$ C! $ C> -l <​​/ code>表示链接)

RewriteCond basically means "execute the next RewriteRule only if this is true". The !-l path is the condition that the request is not for a link (! means not, -l means link)

借助 的重写规则基本上意味着,如果该请求完成匹配<$ c表示$ C> ^(。+)$ (匹配除了服务器根目录的任何URL),它将被改写成的index.php?URL = $ 1 这意味着对于欧莱将被改写成的index.php?URL =欧莱

The RewriteRule basically means that if the request is done that matches ^(.+)$ (matches any URL except the server root), it will be rewritten as index.php?url=$1 which means a request for ollewill be rewritten as index.php?url=olle.

QSA 表示,如果有通过与原来的URL查询字符串,它会被追加到重写(<$ C C $>欧莱?P = 1 将被改写成的index.php URL =欧莱和放大器; P = 1

QSA means that if there's a query string passed with the original URL, it will be appended to the rewrite (olle?p=1 will be rewritten as index.php?url=olle&p=1.

表示,如果规则匹配,不处理在这之下的任何更多的规则集。

L means if the rule matches, don't process any more RewriteRules below this one.

有关这方面的详细完整的信息,请按照上面的链接。重写支持,可以是一个有点难以把握,但也有计算器不少例子可以借鉴。

For more complete info on this, follow the links above. The rewrite support can be a bit hard to grasp, but there are quite a few examples on stackoverflow to learn from.

这篇关于什么$ 1 [QSA,L]意味着我的.htaccess文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆