apache - Issue with RewriteCond -
ive got issue apache's rewrite module. im trying do:
ive got confluence(tomcat) running on server apache reverse proxy in front. also, im using authentification in apache (form auth). if ure trying access [server]/confluence, redirected file login.php containing authentification routine. if login succeeds, proxy lets u access tomcat. every other request blocked. works every request except [server]/login.php file exists indeed in htdocs. every other request handled with
fallbackresource wrong_url.shtml
now want block direct access login.php stuck in dead end.
i tried using rewritecond ${request_uri} phpinfo() gave me this:
<server>/confluence (you automatically redirected login.php apache): php says request_uri = /confluence <server>/login.php: php says request_uri = /login.php
makes sense, though. did is:
<virtualhost *:80> servername 192.168.2.237 rewriteengine on rewritecond %{request_uri} ^/login.php$ rewriterule ^/login.php$ wrong_url.shtml [l] </virtualhost>
but doesnt work properly. either wont work @ or crashes everything. pls forgive me if obvious, im quite beginner rewriting. can tell me wheres fault oder provide me way (propably, easy)?
have checked server logs ? enable , set rewriteloglevel (to 9) , debug request flow.
although don't need mod_rewrite such basic task, use mod_alias instead.
<virtualhost *:80> servername 192.168.2.237 alias /login.php /wrong_url.shtml </virtualhost>
Comments
Post a Comment