|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
authentication before rewrite
I have written an external redirection program in which I 'm dependent to username/passwd from basic auth.
Unfortunately Apache first processes the redirection and thereafter the authentication. Is there a way to change this? |
|
#2
|
|||
|
|||
|
Show us your code.
|
|
#3
|
|||
|
|||
|
ok, my code in httpd.conf:
------snip------ <VirtualHost URL> <Location /> AuthType Basic AuthName "Authtest" AuthUserFile /usr/local/httpd/access/users require valid-user </Location> ServerName URL DocumentRoot /usr/local/httpd/htdocs/ ErrorLog /var/log/httpd/xxxxx-error_log CustomLog /var/log/httpd/xxxxx-access_log combined RewriteEngine on RewriteLog /var/log/httpd/rewrite.log RewriteLogLevel 9 RewriteMap auth-map prg:/tmp/redirection RewriteRule ^/(.*)$ URL${auth-map:$1:%{LA-U:REMOTE_USER}:%{HTTP_COOKIE}} [P] </VirtualHost> ------snap------ Apache every time first proceed the rewrite and thereafter ask me for username/passwd. Into my external program I compare username and cookie-key with a database and give a url of an error page back when they not correspond. Can I change the sequence of the processes or do you have another idea, as I could solve this problem. Thanks in advance. |
|
#4
|
|||
|
|||
|
What do you have for <Directory "/usr/local/httpd/htdocs"> ?
You should move your Rewrite* lines to within that <Directory> block. Also, why don't you use internal redirection instead? |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > authentication before rewrite |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|