Hi Rob,

I'm no expert at mod_rewrite, but to me it looks like your rewrite rule would change:

www.website.com/admin/categories/edit/123

to

www.website.com/admin/dispatch.cgi/admin/categories/edit/123

If your rewrite rules are in a .htaccess file in your /admin directory, you need to change the RewriteBase line to:

RewriteBase /admin

Hope that works for you.

Regards,

David

Rob Mills wrote:
Hi, i've been playing around with CGI::App::Dispatch and all is
working great until I use mod_rewrite to hide the script location. My
dispatch script and .htaccess are located in the "/admin/" folder
(which is an actual folder above the root).

So this works fine: www.website.com/admin/dispatch.cgi/categories/edit/123

But this: www.website.com/admin/categories/edit/123 gives a 500 error
(i'm using carp but nothing comes up). My .htaccess file is the same
as the docs (and normally rewrite is fine) ie:

RewriteEngine on
RewriteBase /
RewriteRule ^(.*)$ /admin/dispatch.cgi/$1 [L,QSA]

I thought it might have something to do with the extra code in the
dispatch script to repair mod_rewrite path problems. Trouble is I
don't actually understand it - can someone help me with it?

use FindBin qw/$Bin/;
use Cwd 'abs_path';
chdir $Bin;
my $www = abs_path("../");
$www =~ s{/usr}{}; # whats this??
$ENV{PATH_INFO} =~ s/^$www//g if defined $ENV{PATH_INFO};

I've been trying for about 4 hours but still the 500 error!
Thanks, Rob

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to