Re: [us...@httpd] apache redirection does not work

2009-10-01 Thread Bob Ionescu
2009/10/1 Sharjeel Tariq : > RewriteCond %{HTTP_HOST} ^example.com$ > RewriteRule ^/(.*)$ http://www.example.com/$1 [L,R] > > > The above rule works for all urls except when I have urls like > > http://example.com/news/headlines/more.jsp?content=20090624_075115_6540 > > Instead of redirecting the a

Re: [us...@httpd] IndexIgnore

2009-09-29 Thread Bob Ionescu
2009/9/24 LuKreme : > IndexIgnore head.html foot.html .. > > Which prevents the "Parent Directory" from showing up in the directory > listing. > > Now, I want to show the "Parent Directory" in the directories under this > one, but there doesn't seem to be an IndexUnignore directive or any syntax >

Re: [us...@httpd] .htaccess not honoured anymore

2009-09-16 Thread Bob Ionescu
2009/9/16 Nico De Ranter : > however the 'require' directive doesn't seem to have any effect anymore? You're overriding it with your definition. A location section overrides directives placed in .htaccess files, see http://httpd.apache.org/docs/2.2/sections.html#mergin Bob -

Re: [us...@httpd] Rewrite Rule question

2009-09-15 Thread Bob Ionescu
2009/9/15 Jai : > We have folloeing rewrite rules in our apache configuration files. > > RewriteRule ^/AuthenticateService/Agent/Authenticate > /AgentAuthenticationService/AgentAuthenticationSoapBindingImplBean [PT] > RewriteRule ^/AuthenticateService/Agent/Authorize > /AgentAuthenticationService/A

Re: [us...@httpd] .htaccess

2009-09-10 Thread Bob Ionescu
2009/9/7 Jos Chrispijn : > Is there a way of forcing webbrowser to present a login popup every time > they enter a protected URL? Now I login once and until I delete my > cookies, I can go to the URL without having a username and password > filled out, even not having the 'remember password' option

Re: [us...@httpd] mod_rewrite internal sub-request returns status 200 instead of expected 404 (mod_proxy issue?)

2009-09-03 Thread Bob Ionescu
2009/9/3 Brett Delle Grazie : > I've tried the sub-request mechanism of mod_rewrite (via !-U condition) > but the sub-request always returns status 200 instead of 404 (even > though the first document doesn't exist on B). > > Does anyone know if this is an existing bug with mod_rewrite or is this >

Re: [us...@httpd] Lookaround assertions in mod_rewrite/mod_alias regex?

2009-09-02 Thread Bob Ionescu
2009/9/2 John Martin : > How can one use lookahead/lookbehind assertions in the regex for a > mod_rewrite RewriteRule, or mod_alias AliasMatch? Currently when I > attempt to use a question mark in my regex, as needed for lookarounds, > I get an internal server error for mod_rewrite, or a syntax err

Re: [us...@httpd] Using Rewrite

2009-08-12 Thread Bob Ionescu
2009/8/12 Alexis : > ok, then the code would be > RewriteCond %{HTTP_HOST} ^files\.example\.com$ [NC] RewriteRule ^(.*)$ > /files/public$1 [L] > or am i wrong? Unless you put RewriteEngine off in a .htaccess file located in your files/public/ folder, that would result in an infinite loop. But only

Re: [us...@httpd] Redirection problem with dynamic url parameters

2009-08-10 Thread Bob Ionescu
2009/8/10 Jonathan Zuckerman : > Ah dammit, obvious mistake, this is better: > RewriteRule ^blog/view\?blogId=(\d+) http://illinois.edu/db/view/$1 [R=301] But it won't work, because the query string is not part of the string which is tested in your rule-pattern. As the docs states, you'll need a R

Re: [us...@httpd] Attempt to serve directory:

2009-07-24 Thread Bob Ionescu
2009/7/17 MK : > >SetHandler perl-script >PerlHandler HTML::Mason::ApacheHandler >AddType text/html mhtml >AddType text/html comp >AddHandler perl-script mhtml comp > > > If I load *localhost/codebank/index.html*, there is no problem. > However, if I try to load *localhost/cod

Re: [us...@httpd] Falling off the end of a directory listing

2009-07-24 Thread Bob Ionescu
2009/7/22 Paul Leder : > Problem: is there some way to allow a directory listing which includes a > 'parent' link, but *only* up to a specified top level? May be you can restrict IndexIgnore .* to some folders via DirectoryMatch (don't know if terminating with $ works to prevent inheritance ^/var/

Re: [us...@httpd] Transparent Proxy Server Installation

2009-07-23 Thread Bob Ionescu
2009/7/23 Brian Kim <09su.resea...@gmail.com>: [...] > [...] Can a reverse apache help for my configuration? See my posting to this list 23 hrs. ago. Bob - The official User-To-User support forum of the Apache HTTP Server Projec

Re: [us...@httpd] Transparent Proxy Server Installation

2009-07-22 Thread Bob Ionescu
2009/7/22 Brian Kim <09su.resea...@gmail.com>: > It means users must not need to set up the proxy configuration > > In that sense, I thought a reverse proxy seems to be the transparent proxy. > > Is it right? IMHO yes. To get such a transparent proxy working with mod_proxy you'll need to work-arou

Re: [us...@httpd] prg with rewrite_map does not seem to be working, maybe a bug

2009-06-30 Thread Bob Ionescu
2009/6/30 Ali Jawad : > isn't it enough to set it to on in .htacccess. Not for the map type prg. But why don't you use the rules in your apache2.conf? Since you're rewriting to a reverse proxy situation, you could avoid the and walk. Bob

Re: [us...@httpd] mod_rewrite on Windows with Apache 2.2

2009-06-30 Thread Bob Ionescu
2009/6/30 tomcatastrophe : > Now I want to add URL rewriting for one of my hosts. > > I added my rules and directive to the virtual host (these work fine on > Linux): > > ProxyPreserveHost On > ProxyPassReverse / ajp://localhost:8009/ > RewriteEngine On > RewriteRule ^/(.*)$ ajp://l

Re: [us...@httpd] prg with rewrite_map does not seem to be working, maybe a bug

2009-06-30 Thread Bob Ionescu
2009/6/30 Ali Jawad : > #Apache2.conf > RewriteLog "/var/log/apache2/rewrite.log" > RewriteLogLevel 9 > RewriteMap dash2score prg:/var/www/getIpStat.pl There's no RewriteEngine directive set to "on" in your Apache2.conf? In such a case the map program shouldn't be started during server startup

Re: [us...@httpd] Mixing rewrite with authn_dbd: Rewriting based on path value stored in mysql table

2009-05-12 Thread Bob Ionescu
2009/5/12 Roman Medina-Heigl Hernandez : > My final solution is: > >RewriteBase /stats >RewriteCond %{REMOTE_USER}/<>$1 !^([^<]+)<>\1 >RewriteRule ^/clientes/(.*) /stats/%{REMOTE_USER}/stats/http/$1 > >RewriteCond $1 !^[^/]+/stats/http

Re: [us...@httpd] Mixing rewrite with authn_dbd: Rewriting based on path value stored in mysql table

2009-05-11 Thread Bob Ionescu
2009/5/11 Roman Medina-Heigl Hernandez : > Bob Ionescu escribió: >> 2009/3/2 Roman Medina-Heigl Hernandez : >>> The problem is that you cannot have %{REMOTE_USER} as 2nd parameters in >>> RewriteCond, so I have no way for comparing it with $1 >> >> -didn

Re: [us...@httpd] Mixing rewrite with authn_dbd: Rewriting based on path value stored in mysql table

2009-05-11 Thread Bob Ionescu
2009/3/2 Roman Medina-Heigl Hernandez : > More comments: > - at the beginning I tried something like: > RewriteBase /stats > RewriteCond $1 !^%{REMOTE_USER}/ > RewriteRule ^/clientes/(.*) > /stats/%{REMOTE_USER}/stats/http/$1 [PT] > > The problem is that yo

Re: [us...@httpd] mod_rewrite redirect to local path issue

2009-03-11 Thread Bob Ionescu
2009/3/11 Steven Bower : > Hi- > I am using mod_rewrite to redirect from a sub-directory of my existing > domain to a new domain just for this section. > Here is my .htaccess file in /othersite/ (specific domains and paths > hidden): > > RewriteEngine on > RewriteBase /othersite/ > Rew

Re: [us...@httpd] exclude errorDocument from authentication

2009-03-02 Thread Bob Ionescu
2009/3/2 : > Given that I have a root “” locked down with authentication and > that I want a custom "ErrorDocument 401 /register.html", how can I exclude > the /register.html page from the authentication location pattern? You can to override the setting with another location section:

Re: [us...@httpd] Problems with redirects...

2009-02-16 Thread Bob Ionescu
2009/2/16 Ken Morley : > Our httpd.conf file contains: > ># Redirects to accomodate PDA's and other tiny screens... >RewriteCond %{HTTP_USER_AGENT} "BlackBerry" [NC] >RewriteCond %{HTTP_HOST} ^www\.saddlebrook\.com$ [NC] >RewriteRule ^/(.*) http://www.saddlebrook.com/pda [L,R] > > T

Re: [us...@httpd] build httpd with OS's PCRE lib

2009-02-10 Thread Bob Ionescu
2009/2/10 Ralf Peng : > How to build Apache with pcre lib provided by OS (such as Linux)? > ( by default apache was built with bundled PCRE library, is it?) 2.0 and 2.2, yes, 2.3/2.4 stop bundling it. > I'm using httpd-2.0.59 from the sources. > when I run ./configure --help |grep -i pcre I got

Re: [us...@httpd] Semantics of "RewriteOptions inherit" in htaccess files needs improvement

2009-02-02 Thread Bob Ionescu
2009/2/2 Matt McCutchen : > On Sun, 2009-02-01 at 23:19 +0100, Bob Ionescu wrote: >> E.g. domain1 points to /var/www, domain2 to /var/www/sub and >> /var/www/sub/.htaccess inherits (i.e. 1:1 copy) /var/www/.htaccess. A >> regEx of ^foo$ in /var/www/sub/.htaccess would match

Re: [us...@httpd] Semantics of "RewriteOptions inherit" in htaccess files needs improvement

2009-02-01 Thread Bob Ionescu
2009/1/31 Matt McCutchen : > #1. Currently, "RewriteOptions inherit" works as if the parent's rules > were copied and pasted into the child (after any other rules). This > means that requests in the child directory are tested against the > parent's rules after stripping the /child's/ RewriteBase.

Re: [us...@httpd] robots.txt and rewrite rule

2009-01-23 Thread Bob Ionescu
2009/1/23 Norman Khine : > RewriteEngine On > #DenyHosts Rules > RewriteMap hosts-deny txt:/home/user/txt/hosts.deny > RewriteCond ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND} !=NOT-FOUND [OR] > RewriteCond ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND} !=NOT-FOUND [OR] > RewriteCond ${h

Re: [us...@httpd] robots.txt and rewrite rule

2009-01-22 Thread Bob Ionescu
2009/1/22 Norman Khine : > Is there a way I can put a robots.txt file to reside outside of the > rewrite, so that if a the bots look for http://domain.com/robots.txt > the rewrite does not push it to the > localhost:12080/companies/robots.txt Just exclude the specific path: RewriteCond $1 !=robot

Re: [us...@httpd] ReWrite woes

2009-01-14 Thread Bob Ionescu
2009/1/14 Sheldon Ross : >RewriteRule ^/bob$ /temp1/temp1/temp2 That rule (with 'RewriteEngine on' as already mentioned) wouldn't match in a section (per-directory context) but it would match outside of the section (per-server context). Strip the leading slash of the pattern for

Re: [us...@httpd] mod_rewrite redirects instead of silent rewrite

2009-01-13 Thread Bob Ionescu
2009/1/13 Marcin : > I've tried to add > > RewriteEngine On > RewriteCond %{HTTP_HOST} (.+)\.demo\.myapp\.com$ > RewriteRule ^/$ /usersite/%1 > > but the effect is that apache is looking for a file /some/path/usersite/lucy May be you want to add the [PT] flag? Bob ---

Re: [us...@httpd] Setting DirectoryIndex to a Location?

2009-01-12 Thread Bob Ionescu
2009/1/12 Michael Ludwig : > Bob Ionescu schrieb: >> http://httpd.apache.org/docs/2.2/sections.html#mergin > > Thanks. This helps a bit. But I still don't quite understand the > meaning of "be applied" and "be evaluated" in this section. Does this > r

Re: [us...@httpd] Setting DirectoryIndex to a Location?

2009-01-12 Thread Bob Ionescu
2009/1/12 Michael Ludwig : > Bob Ionescu schrieb: >> The location walk will be processed (again) after the directory and >> file walk. > > So my assumption was wrong. Does anyone know in which document this > behaviour is described? http://httpd.apache.org/docs/2.2/sect

Re: [us...@httpd] mod_rewrite, passing GET variables forward

2009-01-11 Thread Bob Ionescu
2009/1/11 Kae Verens : > I want to rewrite /foo?bar=red to /index.php?page=foo&bar=red > I try it with this, but it does not work: > RewriteRule ^(.*)\?(.*)$ /index.php?page=$1&$2 [L] The query string is not part of the rule-patern as described in the manual. You're looking for the QSA flag to app

Re: [us...@httpd] Setting DirectoryIndex to a Location?

2009-01-09 Thread Bob Ionescu
2009/1/9 Michael Ludwig : > I think here's what happens: By the time Apache has decided, following > the Alias, to use the container to locate the requested > resource, it is already tied to the filesystem context; and it is now > too late to take any containers into account. The location walk w

Re: [us...@httpd] Problem with URI conversion on Apache-1.3.41

2009-01-09 Thread Bob Ionescu
2009/1/9 sathya sai : > with apache-1.3 Try to upgrade to the 2.2 branch. The mapping of UTF-8 characters to the filesystem works there since Apache 2 (or better APR) supports unicode on Windows, which you have already mentioned above. > if this is known issue with apache-1.3 I would call it a (

Re: [us...@httpd] rewrite rule ideas needed..

2009-01-09 Thread Bob Ionescu
2009/1/9 Anders Norrbring : > But how can I create a setup that will simple add www to any of the valid > ServerAlias names listed in the virtual host? They shall keep the domain > name part as is, and not rewrite to one name only. Have a look at the last example of the section "Canonical Hostnam

Re: [us...@httpd] Re: help with rewrites - changing the base path

2008-12-29 Thread Bob Ionescu
2008/12/29 Matthew Sacks : > I cleared all rewrites so all I have is the following: > RewriteRule ^/techblog(.*)$ http://www.foo.com/$1 [R=301] If you're using this in per-dir context (e.g. in .htaccess files) reachable via http://www.example.com/.htaccess, strip the leading slash of the pattern:

Re: [us...@httpd] Subdomains Hosting

2008-12-22 Thread Bob Ionescu
2008/12/22 Ivan Zanev : > Now, in my File System I would like > to structure the directories in the following way: > > users/Superman/sub1/ > users/Superman/sub2/ > > Where Superman is our username (He added the two subdomains noted above). > > The problem: How to do this? I've read much about the

Re: [us...@httpd] RewriteRule

2008-12-22 Thread Bob Ionescu
2008/12/22 Andrew Hole : > I'm trying to setup a RewriteRule to redirect requests to a new different > server , but I want to keep the original URL on address bar. > How can I do that? Use the P flag to force that the request is handled by mod_proxy et al. (reverse proxying). Bob ---

Re: Using AuthName with mod_rewrite

2008-12-18 Thread Bob Ionescu
> When I use > RewriteEngine on > RewriteCond %{REMOTE_USER} ^ That RegEx is always true (so you can skip the condition). To check for at least one character present, use a '.', i.e. %{REMOTE_USER} . But anyway... > RewriteRule ^/$ http://localhost/home.seam?userid=%{REMOTE_USER} [L] That is

Re: RewriteRule / RewriteCond don't interpolate server variables in pattern regex

2008-12-15 Thread Bob Ionescu
2008/12/15 Pavel Ustyugov : > RewriteEngine On > RewriteBase / > RewriteCond %{REMOTE_USER} !^$ > RewriteRule !^usr/%{REMOTE_USER}/ /usr/%{REMOTE_USER}/ [R] > === > If user try to get out from own dir, server forcibly redirect him to correct > dir. > But, this ru

Re: [EMAIL PROTECTED] mod_rewrite %{REQUEST_URI} Question

2006-09-26 Thread Bob Ionescu
Rob Wilkerson wrote: RewriteRule ^/(.*) /landingpage.php?requesturi=%{REQUEST_URI}[QSA,PT] This works fine except when I have a document (these documents are uploaded by users so I have little control over them) called "My Resume & Cover Letter.doc", for example. The "&", having special mea

Re: [EMAIL PROTECTED] Mod_rewrite and default document

2006-09-11 Thread Bob Ionescu
Erik Funkenbusch wrote: # 1 rewrite /?id=123 as index.php?id=123 - Does not work It is intended *not* to match in this case - and if you are using numerical values, why are you using the regEx .* which matches too much, your second rule will never work, because the first one will match once

Re: [EMAIL PROTECTED] Mod_rewrite and default document

2006-09-08 Thread Bob Ionescu
Erik Funkenbusch wrote: RewriteRule !^index\.php.* - [C] RewriteRule ^(.*) index.php?id=$1 [L] However, this doesn't work with the original form: http://domain/?id=123 Can anyone offer any suggestions on making this work with the implied default document and a query string? Thanks. Use Rew

Re: [EMAIL PROTECTED] RE: case insensitive rewrite rules and nested mapping

2006-09-05 Thread Bob Ionescu
Chen, Charles wrote: I didn't know I could use $1 in this way: i.e., back referenced in condition before the rule. The order of processing is rule-pattern --> condition(s) --> rule-substitution So back references created in the rule-pattern will be available in the test string of the conditio

Re: [EMAIL PROTECTED] RE: case insensitive rewrite rules and nested mapping

2006-09-05 Thread Bob Ionescu
Chen, Charles wrote: here, "/NeWs" first mapped to all upper case "NEWS" and then used to lookup another map in which I have a line like this: # my text map file NEWS /some/other/url What about using a condition to get the value: RewriteMap somemap txt:somemap.map RewriteMap toupper int:toup

Re: [EMAIL PROTECTED] 503 response with mod_rewrite?

2006-08-25 Thread Bob Ionescu
Evaldas Imbrasas wrote: On 8/25/06, Joshua Slive <[EMAIL PROTECTED]> wrote: On 8/25/06, Evaldas Imbrasas <[EMAIL PROTECTED]> wrote: > Is there a way to do this redirect on a conditional as a rewrite rule > allows, though? I.e., return a 503 if a certain file exists? Sure, just make "a certain f

Re: [EMAIL PROTECTED] redirect only if a URL does not exists

2006-08-23 Thread Bob Ionescu
Lothar Krenzien wrote: Hi there, Now I want to redirect a request *ONLY* if the URL does not exist. I know the !-U flag for a RewriteCond but can't get it working. -U checks only access controls and not if your URL-path resolves to an existing resource.

Re: [EMAIL PROTECTED] mod_rewrite, windows problems

2006-08-18 Thread Bob Ionescu
Tim Stickland wrote: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . %{REQUEST_FILENAME}.php [L] Don't use a physical path here, use r->uri instead. RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d R