Re: Can you go outside the .htaccess directory with Rewrite Rule?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 28, 2009 at 4:05 AM, Sean DeNigris <sean@xxxxxxxxxxxxxxxx> wrote:

> Thanks for the help!!
> Ok I'm encouraged that it's possible, but my example resolves to
> /~user/public_html/cgi-bin/, not /~user/cgi-bin/, which is what I want, and
> what it sounds like you're saying it should do, so how do I get this
> filesystem behavior?

You need to restart request processing after the rewrite. For this you
add the PT flag. To quote the manual:
"The target (or substitution string) in a RewriteRule is assumed to be
a file path, by default. The use of the [PT] flag causes it to be
treated as a URI instead. That is to say, the use of the [PT] flag
causes the result of the RewriteRule to be passed back through URL
mapping, so that location-based mappings, such as Alias, for example,
might have a chance to take effect. "

So your rule needs to look like this:

RewriteRule ^(.*)$ /cgi-bin/scriptname.cgi?action=$1 [PT]


Krist

-- 
krist.vanbesien@xxxxxxxxx
krist@xxxxxxxxxxxxx
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux