[ic] removing .../cgi-bin/catname/... from URLs
Jon Jensen
jon at endpoint.com
Thu Dec 14 00:54:06 EST 2006
On Wed, 13 Dec 2006, Peter wrote:
>> I've verified that Catalog definition indeed has the format:
>>
>> Catalog mycat /home/someuser/catalogs/mycat /cgi-bin/mycat /
>>
>> yet IC is still including the .../cgi-bin/mycat/... in the URLs. I
>> restarted IC just for kicks yet still no luck. Can you suggest a way to
>> troubleshoot?
>>
>> I've noticed that the misbehaving store has a CGI_URL defined in the
>> Prefernces tab of the Admin GUI, but the behaving store does not. Could
>> this be the cause?
>
> Indirectly, yes. Look for VendURL and SecureURL in catalog.cfg.
DB,
I need to explain my earlier reply better. What Peter says about VendURL
is in general correct. However, when you have any URL prefix aliases
defined for the catalog, if a request comes in through one of them, that
will override VendURL for all future URLs written by [area] etc. The
manual explains this:
http://www.icdevgroup.org/docs/confs/Catalog.html
So my example only makes sense if taken in the context of an Apache setup
for making pretty catalog URLs, such as this:
ScriptAlias /cgi-bin/ /path/to/your/cgi-bin/dir/
RewriteEngine on
RewriteRule ^/store/(.*) /cgi-bin/standard/$1 [PT,L]
Then you'd set up interchange.cfg like this:
Catalog standard /path/to/catalogs/standard /cgi-bin/standard /store
Thus, users would go to this URL to enter the site:
http://your.domain/store/
But Interchange would see you coming in through:
http://your.domain/cgi-bin/standard/
because of the Apache RewriteRule.
The first URL prefix is considered the "main" one, not an alias, and does
not take over URL generation as an alias does, so the Catalog definition
above doesn't lead to aliases URL generation; it just stays normal.
But in the end it turns out that the /store alias I showed in my example
isn't even necessary; Interchange never uses it or needs it to find the
catalog, because it's seeing /cgi-bin/standard as the path prefix after
URL rewriting.
So, to sum up, I think your problem may be fixed with this Catalog
directive:
Catalog mycat /home/someuser/catalogs/mycat /
assuming you have in Apache something like:
RewriteRule ^/(.*) /cgi-bin/mycat/$1 [PT,L]
Though to take over the whole URL space like that, you'd need to have some
previous RewriteRules that would make exceptions to statically serve
images, CSS, JavaScript, robots.txt, favicon.ico, etc. directly from
Apache, not passing them to Interchange.
You'll get a lot more wasted requests passed through to Interchange by
hostile bots, etc., which wouldn't be if you use a prefix like /store/ or
/ic/ or /app/ or something like that. You can still make the home page use
the root URL http://your.domain/ with another RewriteRule like:
RewriteRule ^/(index.html?)?$ /cgi-bin/standard/index [PT,L]
HTH,
Jon
--
Jon Jensen
End Point Corporation
http://www.endpoint.com/
More information about the interchange-users
mailing list