开发者

RewriteCond writing help

开发者 https://www.devze.com 2023-03-15 04:20 出处:网络
I need to write a RewriteCond which checks for \"blogs\" wor开发者_开发问答d in request_uri, only then proceed ahead.

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

精彩评论

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