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

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

 



On Fri, Feb 27, 2009 at 4:27 PM, Sean DeNigris <sean@xxxxxxxxxxxxxxxx> wrote:
> If I put a .htaccess file in my webroot with the following rule:
> RewriteRule ^(.*)$ /cgi-bin/scriptname.cgi?action=$1
>
> Can I specify a script file outside the directory with the .htaccess file in
> it (i.e. outside the webroot)?

Yes, the 2nd argument to RewriteRule is actually a filesystem path and
not a URL -- rewrite helps you out sometimes when you use the latter.
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?
With the default conf, directory trees are explicitly allowed to be
served via "order" and "allow", so whatever you rewrite to will to
have a Directory stanza that allows access.
I'm not sure what this means.

Sean

---------------------------------------------------------------------
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