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]
精彩评论