Re: mod_rewrite and WO to rewrite /index.html into

Chuck Hill <[email protected]> Fri, 2 Dec 2005 11:19:20 -0800
Newsgroups gmane.comp.web.webobjects.admin
Message-ID <[email protected]>
On Dec 2, 2005, at 11:01 AM, Chad Leigh wrote:

>
> I would like a simple apache rewrite of /index.html into the start  
> of my wo-app.  I do not want a redirect but want /index.html to  
> actually return the main page of my app without a redirect.  Right  
> now I am just interested in the main page.   Maybe later I will  
> play with other things.
>
> Anyway, I have googled WO and mod_rewrite and it says, if I  
> understood things correctly, in the various posts, to place  
> mod_rewrite after the AddModule / LoadModule for mod_webobjects.  I  
> have done that (have actually tried both).
>
You need both.  And yes, rewrite goes _after_ webobjects.


> My rule is a simple one
>
>     RewriteEngine on
>     RewriteLog logs/mysite.com-rewrite_log
>     RewriteRule ^index\.html$ cgi-bin/WebObjects/app.woa
>
This should be
RewriteRule 		^/index\.html$ 	/cgi-bin/WebObjects/app.woa [L, PT]

I would also add

RewriteRule 		^/$ 				/cgi-bin/WebObjects/app.woa [L, PT]

Note the leading /


> I have also tried it with [PT] for pass-through at the end of the rule
>
You do want that so that the user will not see the change.


> Nothing happens and I do not get anything in the rewrite log, which  
> was created but stays 0 length.
>
> Has anyone used rewriting in this way?
>
Constantly.

Chuck

-- 
Coming in 2006 - an introduction to web applications using WebObjects  
and Xcode     http://www.global-village.net/wointro

Practical WebObjects - for developers who want to increase their  
overall knowledge of WebObjects or who are trying to solve specific  
problems.    http://www.global-village.net/products/practical_webobjects