开发者

RewriteCond writing help

I need to write a RewriteCond which checks for "blogs" wor开发者_开发问答d in request_uri, only then proceed ahead.

Something like this

RewriteCond %{REQUEST_URI} ^/xml/abc/http://blogs.*  

is this syntactically correct?

Any help would be appreciate on this.


REQUEST_URI won't contain the hostname. If you're trying to detect http://blogs.yoursite.com you need to use HTTP_HOST

RewriteCond %{HTTP_HOST} ^blogs\. [NC]
RewriteRule ...

edit:

I don't think you can decode the url, so just skip the encoded parts in your regex. You don't even need a RewriteCond :

RewriteRule ^/?xml/abc/(http.+blogs\..*) /foo/bar?q=$1 [L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜