Re: [users@httpd] Regular Expression Question

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

 



hmm... well those two expressions aren't doing what i'm wanting, but that my be because i'm going about it wrong.

let me explain what i'm trying to do:

i've got a primary domain used for my website:

    foo.com


then there is another domain which has no other files on it except a single cgi script that gets called from a piece of software that i sell:

    foo.net


the cgi script is at:

    http://foo.net/cgi-bin/mycgiscript



all of that works fine. people go to foo.com to look at the website and the software that they get there calls the cgi script on the other domain (foo.net). no one would normally go to the other domain using their web browser.

but... if someone does type in "foo.net" in their web browser, i want them to be redirected to the primary domain (foo.com).

basically, i need ALL http requests to foo.net to be redirected to foo.com EXCEPT http://foo.net/cgi-bin/mycgiscript .

so, to do this, i'm trying to set up a RedirectMatch in my .htaccess file on foo.net:

    RedirectMatch 301 [^/cgi-bin/mycgiscript$] http://www.foo.com/

i need something that says "if it's not mycgiscript, redirect it to foo.com."

the RedirectMatch expression above redirects requests for the cgi script to foo.com, which results in a 404, because it doesn't exist on that web server. and requests to other files result in a 500 error (from foo.net) and when i look at the error log, i see: "Regular expression could not be compiled".

how can i get this to work?

thanks.

- chase








On Jul 27, 2005, at 8:39 PM, Wagner, Aaron wrote:

[^/cgi-bin/mycgiscript$]


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