문제

My Situation:

I implemented an apache Rewrite Map to redirect incoming requests based on a database

 RewriteEngine On
 RewriteMap dbapp prg:/usr/local/somewhere/dbapp.rb
 RewriteRule ^/(pattern)$ ${dbapp:$1} [R]

So far everything works fine, but I want to decide in the dbapp.rb script weather to redirect or give the client a http-status-code-404. I could just deliver a local page that doesn't exist but that doesn't seem right. I also want this to be usable on any server, and redirecting to "localhost" is also not an option ;-)

도움이 되었습니까?

해결책

You could return -, which essentially means: 'no rewrite', but I don't know whether that's supported in a maps/[R] combination. Better may be to check with RewriteCond ${dbapp:$1} !^$ or something that it doesn't contain an empty string.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top