我有一些麻烦,了解如何动态地把简单的一种语言的网站。如果有人能用婴儿语言向我解释下面代码的每一部分是什么意思,我会非常感激的:
RewriteEngine On
RewriteCond %{REQUEST_URI} !\.(php|css|js|gif|png|jpe?g|pdf)$
RewriteRule (.*)$ templates/index.php [L]
提前谢谢你!
发布于 2013-10-31 01:20:43
# Enable RewriteEngine to rewrite URL patterns
RewriteEngine On
# Every URI that not (! operator) ends with one of .php, .css, .js, .gif, .png, .jpg, .jpeg or .pdf
RewriteCond %{REQUEST_URI} !\.(php|css|js|gif|png|jpe?g|pdf)$
# Will be redirected to templates/index.php
RewriteRule (.*)$ templates/index.php [L]
# Sample
# /foo/bar.php -> /foo/bar.php
# /foo/bar.html -> templates/index.php
发布于 2013-10-31 01:23:20
RewriteEngine On
打开重写引擎
RewriteCond %{REQUEST_URI} !\.(php|css|js|gif|png|jpe?g|pdf)$
匹配所有不以.php、.css等结尾的请求。
!
=否定以下表达式(“匹配不匹配”)\.
=一个点(必须转义,所以它是字面意思)。如果没有反斜杠,它将匹配每个字符)(php|css|js|gif|png|jpe?g|pdf)
=这些选项之一。jpe?g
意味着e
是可选的,因此它与jpg
和jpeg
匹配。$
=请求的结束。RewriteRule (.*)$ templates/index.php [L]
将所有不匹配正则表达式的请求重定向到templates/index.php
。[L]
意味着这是最后一条规则,所以不能应用来自.htaccess的其他规则。
发布于 2013-10-31 01:21:11
https://stackoverflow.com/questions/19702412
复制相似问题