You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by PAlvin <pe...@awebabove.com> on 2005/04/24 21:25:28 UTC

How get www.site.com homepage requests to forward to Tomcat without a redirect?

I'm currently using Tomcat 4.
 
When someone goes to my site, say, www.site.com, I'd like it run a 
servlet for the home page instead of a static page (my entire site is
dynamic).
 
I configured the connector to send all *.htm files to Tomcat and I 
created a re-write rule in the Apache configuration file like this:
 
   RewriteEngine on
   RewriteRule ^/$ /home.htm [R]
 
This works great, EXCEPT, that the browser is sent a redirect and I 
heard that is bad for search engines.
 
I could send *all* http requests to tomcat, BUT, obviously, I DON'T 
want Tomcat serving up images.
 
So, is there any way to configure Apache and/or Tomcat to make:
 
   www.site.com ---run--> www.site.com/home.htm
 
without a redirect?
 
How do I get www.site.com requests to go to Tomcat???
 
Peter Alvin
mobile 719-210-3858
skype 'smartmicro'







---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How get www.site.com homepage requests to forward to Tomcat without a redirect?

Posted by Jason Bainbridge <jb...@gmail.com>.
On 5/12/05, PAlvin <pe...@awebabove.com> wrote:
> Removing the [R] from the RewriteRule breaks everything and no page
> is served:
> 
>     RewriteRule ^/$ /home.htm          **does not work**
> 
> I'm curious: how does everyone else map the domain request to an
> actual page???
> 
>     domain.com --to--> domain.com/home.htm
> 
> Everyone must be doing this, right?  What are other solutions for
> doing this?

Am I missing something here or do you just need:

<welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

in your web.xml or the same thing in Apache?



-- 
Jason Bainbridge
http://kde.org - webmaster@kde.org
Personal Site - http://jasonbainbridge.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How get www.site.com homepage requests to forward to Tomcat without a redirect?

Posted by Anto Paul <an...@gmail.com>.
On 4/25/05, Trond G. Ziarkowski <tr...@gep-as.com> wrote:
> Hi,
> 
> try removing the [R] from your RewriteRule. If you read up on the
> mod_rewrite docs, you should see that the [R] flag is causing the redirect.
> 
> Trond
> 
> PAlvin wrote:
> 
> >I'm currently using Tomcat 4.
> >
> >When someone goes to my site, say, www.site.com, I'd like it run a
> >servlet for the home page instead of a static page (my entire site is
> >dynamic).
> >
> >I configured the connector to send all *.htm files to Tomcat and I
> >created a re-write rule in the Apache configuration file like this:
> >
> >   RewriteEngine on
> >   RewriteRule ^/$ /home.htm [R]
> >
> >This works great, EXCEPT, that the browser is sent a redirect and I
> >heard that is bad for search engines.
> >
> >I could send *all* http requests to tomcat, BUT, obviously, I DON'T
> >want Tomcat serving up images.
> >
> >So, is there any way to configure Apache and/or Tomcat to make:
> >
> >   www.site.com ---run--> www.site.com/home.htm
> >
> >without a redirect?
> >
> >How do I get www.site.com requests to go to Tomcat???
> >
> >Peter Alvin
> >mobile 719-210-3858
> >skype 'smartmicro'
> >
> >
> >
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 

You may need to add PT as also which tells Apache to pass on the
request to the JK connector.

-- 
rgds
Anto Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How get www.site.com homepage requests to forward to Tomcat without a redirect?

Posted by PAlvin <pe...@awebabove.com>.
Removing the [R] from the RewriteRule breaks everything and no page 
is served:

    RewriteRule ^/$ /home.htm          **does not work**

I'm curious: how does everyone else map the domain request to an 
actual page???

    domain.com --to--> domain.com/home.htm

Everyone must be doing this, right?  What are other solutions for 
doing this?

Pete



On Mon, 25 Apr 2005 08:13:19 +0200, Trond G. Ziarkowski wrote:
>Hi,
>
>try removing the [R] from your RewriteRule. If you read up on the
>mod_rewrite docs, you should see that the [R] flag is causing the
>redirect.
>
>Trond
>
>PAlvin wrote:
>
>>I'm currently using Tomcat 4.
>>
>>When someone goes to my site, say, www.site.com, I'd like it run a
>>servlet for the home page instead of a static page (my entire site
>>is
>>dynamic).
>>
>>I configured the connector to send all *.htm files to Tomcat and I
>>created a re-write rule in the Apache configuration file like this:
>>
>>RewriteEngine on
>>RewriteRule ^/$ /home.htm [R]
>>
>>This works great, EXCEPT, that the browser is sent a redirect and I
>>heard that is bad for search engines.
>>
>>I could send *all* http requests to tomcat, BUT, obviously, I DON'T
>>want Tomcat serving up images.
>>
>>So, is there any way to configure Apache and/or Tomcat to make:
>>
>>www.site.com ---run--> www.site.com/home.htm
>>
>>without a redirect?
>>
>>How do I get www.site.com requests to go to Tomcat???
>>
>>Peter Alvin
>>mobile 719-210-3858
>>skype 'smartmicro'
>>
>>
>>
>>
>>
>>
>>
>>--------------------------------------------------------------------
>>-
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: 
tomcat-user-help@jakarta.apache.org
>>
>>
>>
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org







---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How get www.site.com homepage requests to forward to Tomcat without a redirect?

Posted by "Trond G. Ziarkowski" <tr...@gep-as.com>.
Hi,

try removing the [R] from your RewriteRule. If you read up on the 
mod_rewrite docs, you should see that the [R] flag is causing the redirect.

Trond

PAlvin wrote:

>I'm currently using Tomcat 4.
> 
>When someone goes to my site, say, www.site.com, I'd like it run a 
>servlet for the home page instead of a static page (my entire site is
>dynamic).
> 
>I configured the connector to send all *.htm files to Tomcat and I 
>created a re-write rule in the Apache configuration file like this:
> 
>   RewriteEngine on
>   RewriteRule ^/$ /home.htm [R]
> 
>This works great, EXCEPT, that the browser is sent a redirect and I 
>heard that is bad for search engines.
> 
>I could send *all* http requests to tomcat, BUT, obviously, I DON'T 
>want Tomcat serving up images.
> 
>So, is there any way to configure Apache and/or Tomcat to make:
> 
>   www.site.com ---run--> www.site.com/home.htm
> 
>without a redirect?
> 
>How do I get www.site.com requests to go to Tomcat???
> 
>Peter Alvin
>mobile 719-210-3858
>skype 'smartmicro'
>
>
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How get www.site.com homepage requests to forward to Tomcat without a redirect?

Posted by Will Hartung <wi...@msoft.com>.
> From: "PAlvin" <pe...@awebabove.com>
> Sent: Monday, April 25, 2005 12:24 PM


> (We get about 1,000 visitors a day to our site.)

> Just curious: Isn't Tomcat responses inefficient because it has to
> pass the response back to Apache via a named pipe or TCP or some
> other connector mechanism?

Technically, yes. Realistically, no. Does that hand off and transfer affect
the total overall packet time? Of course, but it's all handled within the
kernel of the machine, versus going out over the wire, so it's not really
noticable. Measureable? Sure. But so is shortening your network cables. Want
to easily speed up your network traffic 100%? Cut all of your cables in
half. So, seriously, don't worry about it too much.

If your site is getting 1000 visitors a day, over 10 hours, that's less than
2 per minute. You can look at your logs and measure your peak times if you
like. Trust me, you're not stressing anything here, and Tomcat will have no
problems whatsoever handling that traffic. Would it handle the 1000 users if
they all showed up at once? Probably not, but you'd be fixing other things
before Tomcat then anyway.

Tomcat will happily saturate your internet connection.

Best of luck.

Regards,

Will Hartung
(willh@msoft.com)


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How get www.site.com homepage requests to forward to Tomcat without a redirect?

Posted by PAlvin <pe...@awebabove.com>.
(We get about 1,000 visitors a day to our site.)
 
Just curious: Isn't Tomcat responses inefficient because it has to 
pass the response back to Apache via a named pipe or TCP or some 
other connector mechanism?
 
Peter Alvin




>How much traffic are you really getting to your site? If you're like
>a
>majority of sites, not enough that the benefit of Apache is going to
>really
>be noticable.
>
>Regards,
>
>Will Hartung
>(willh@msoft.com)



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How get www.site.com homepage requests to forward to Tomcat without a redirect?

Posted by Will Hartung <wi...@msoft.com>.
> From: "PAlvin" <pe...@awebabove.com>
> Sent: Sunday, April 24, 2005 12:25 PM

> I could send *all* http requests to tomcat, BUT, obviously, I DON'T
> want Tomcat serving up images.

Why not? Tomcat is fine for static content.

How much traffic are you really getting to your site? If you're like a
majority of sites, not enough that the benefit of Apache is going to really
be noticable.

Regards,

Will Hartung
(willh@msoft.com)


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org