Page 1 of 1

problems with RegEx in RewriteEngine

Posted: Wed Jan 18, 2006 12:32 pm
by nicoone
Hi,
im doing like this to protect one file in CGI-BIN directory it's cgi file wich starts as image...
here is code in .htaccess

Code: Select all

<Files image*>

order deny,allow
deny from all
AuthType Basic
AuthName "The Clinic Mebers Area"
AuthUserFile /usr/home/therubbe/public_html/cgi-bin/i4wt3KdSZeNMcPkG8TJFRoDWCArpxyfL/password/.htpasswd
require valid-user
satisfy any

RewriteEngine on
RewriteCond /usr/home/therubbe/public_html/cgi-bin/9A41hX7AX0/admin/data/suspended/%{REMOTE_USER} -f
RewriteRule /* http://www.therubberduck.com/ [L,R]
RewriteCond /usr/home/therubbe/public_html/cgi-bin/9A41hX7AX0/admin/data/ips/%{REMOTE_ADDR} !-f
RewriteCond %{HTTP_COOKIE} !.*setup.*
RewriteRule /* http://%{HTTP_HOST}/cgi-bin/9A41hX7AX0/sentry.cgi?setup+%{REMOTE_USER}+%{REMOTE_ADDR}+%{REQUEST_URI}?%{QUERY_STRING} [L,R]

</Files>
and after Authorization im getting this:

Forbidden
You don't have permission to access /cgi-bin/imageFolio.cgi on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

where is my mistake ?

Cheers,
Nico


feyd | changed url: NWS content

Posted: Wed Jan 18, 2006 6:12 pm
by Jenk
rewriterule(s) should look like:

Code: Select all

ReWriteRule ^*$ page.html
Rewrites don't affect the domain, only the query string and any directorys.. looks like you want redirects and not rewrites..

btw - please remove that link.. not exactly pleasant viewing, thanks.

infact.. is this just an excuse to get SEO ratings up?