problems with RegEx in RewriteEngine

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
nicoone
Forum Newbie
Posts: 1
Joined: Wed Jan 18, 2006 12:27 pm

problems with RegEx in RewriteEngine

Post 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
Last edited by nicoone on Thu Jan 19, 2006 4:28 am, edited 1 time in total.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post 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?
Post Reply