Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

redirect - Apache 2.4 RewriteRule [R] works but not with [P]

Surly it's only a slight misunderstanding, but I'm stuck with a small problem for days. So I beg for your help

I'm trying to hide small REST-Service behind an Apache2.4 Server

  • The redirection works fine: RewriteRule "^/apis/resolver/(.*)" "http://otherhost:10000/$1" [R]

  • But with the Flag 'P' the Apache responds with 404. RewriteRule "^/apis/resolver/(.*)" "http://otherhost:10000/$1" [P] Yes, the 'apache' can reach 'otherhost'. :)

Additional Info:

In the error_log I found a hint [rewrite:trace2] ... [perdir /] rewrite 'proxy:http://otherhost:10000/foo/bar' -> '/index.php'

This is related to a part of the confiuration for WP:

<Location "/">
   RewriteRule ^index.php$ - [L]
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule . /index.php [L]
</Location>

So I have to redefine my question: "Why is the flag [R] implicit [Last] but [P] not?"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

Just Browsing Browsing

[4] html - How to create even cell spacing within a

1.4m articles

1.4m replys

5 comments

57.0k users

...