小编Ali*_*air的帖子

在RewriteCond文件中使用更改的%{REQUEST_URI}存在检查

我想要一个URL,例如http://localhost/universe/networks/o2/o2_logo.gif并执行以下操作:

If it begins with /universe/
Strip /universe/ from it to become /networks/o2/o2_logo.gif
Check if this exists in %{DOCUMENT_ROOT}/networks/o2/o2_logo.gif
If so, silently rewrite the request to this file.

如果我使用以下规则:

RewriteCond %{REQUEST_URI} ^/universe/
RewriteRule ^(.*)$ http://www.example.org/$1 [L]

http://localhost/universe/networks/o2/o2_logo.gif重新写入http://www.example.org/networks/o2/o2_logo.gif这很棒,但我似乎无法使用

我怎样才能进一步使用这个'更改'%{REQUEST_URI},如$ 1或者其他什么?

apache .htaccess

8
推荐指数
1
解决办法
7万
查看次数

标签 统计

.htaccess ×1

apache ×1