httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shyne <...@shyne.ch>
Subject Re: [users@httpd] mod_rewrite directives problem
Date Mon, 20 Feb 2006 13:06:06 GMT
In the meantime I have found out that the problem was, that the 
directive needed a physical path in order to operate:

    RewriteEngine on
    RewriteCond /data/www/htdocs/mysite%{REQUEST_FILENAME} !-d
    RewriteCond /data/www/htdocs/mysite%{REQUEST_FILENAME} !-f
    RewriteRule ^/help?(.*)$ /help/index.php?id=$2 [L,QSA]

This finally does the job.

Thanks for listening & greetings,
Carole.



Oliver.Schaudt@unilog.de wrote:
>> Apparently the directive RewriteCond %{REQUEST_FILENAME} !-f matches 
>> requests for existing files, which it should exactly not do.
>> I try to filter out all requests for non existing documents and folders 
>> and lead them to my script, but leave the existing stuff untouched.
>>     
>
> !-f says "NOT an existing filename"
> -f  says "is an existing filename"
> There are "-d" for directories and "-l" for links.
>
> If you have all together [ !-f, !-d, (!-l if you are using symlinks) ] than you have
exact what you want.
>
>
> bye
> Oliver
>
> -----Urspr√ľngliche Nachricht-----
> Von: Shyne [mailto:cho@shyne.ch]
> Gesendet: Mo 20.02.2006 13:11
> An: users@httpd.apache.org
> Betreff: Re: [users@httpd] mod_rewrite directives problem
>  
> Hi Robert
>
> Thanks for your answer.
>
> I changed the directives according to your input and installed the log.
>
> Apparently the directive RewriteCond %{REQUEST_FILENAME} !-f matches 
> requests for existing files, which it should exactly not do.
> I try to filter out all requests for non existing documents and folders 
> and lead them to my script, but leave the existing stuff untouched.
>
> Is there a different way to do the filtering for non existing documents 
> (with leaving what has been entered in the Address Bar unchanged)?
>
> Thanks and greetings,
> Carole.
>
>
> Robert Ionescu wrote:
>   
>> Shyne wrote:
>>     
>>> <VirtualHost *:80>
>>> ...
>>>
>>>    RewriteEngine on
>>>    RewriteCond /help/%(REQUEST_URI) !-d
>>>    RewriteCond /help/%(REQUEST_URI) !-f
>>>
>>>    RewriteRule ^help/?(.*)$ /help/index.php?id=$1 [L,QSA]
>>>
>>> </VirtualHost>
>>>
>>>
>>> - I am not sure if /help/%(REQUEST_URI) points to the right place, but 
>>>       
>> Round parenthesis are wrong, you must use {...}, but consider using
>>
>> RewriteCond %{REQUEST_FILENAME} !-d
>> RewriteCond %{REQUEST_FILENAME} !-f
>>
>>     
>>> - Should it be ^help/ or ^/help/
>>>       
>> In per-server context: ^/help/
>>
>> In order to debug RewriteRules, use a RewriteLog
>>
>> RewriteLog logs/rewrite
>> Rewriteloglevel 5
>>
>>     
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>   
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

Mime
View raw message