You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Lalit Kapoor <la...@gmail.com> on 2007/08/09 01:17:52 UTC

[users@httpd] ReWrite Rule

Hello,

I am new to apache community.

I need to put rewrite rule in such a way that
http://community.brand.comshould end up at
http://community.brand.com/base/index.jspa.

Please see if you have any such rule available or please provide some
pointer for the same.

Thanks,
Lalit Kapoor

Re: [users@httpd] ReWrite Rule

Posted by Lalit Kapoor <la...@gmail.com>.
Thanks.
Will try and share results. I am using main server and will be putting rules
directly
in virtual host block.

On 8/9/07, Vincent Bray <no...@gmail.com> wrote:
>
> On 09/08/07, Lalit Kapoor <la...@gmail.com> wrote:
> > Hello,
> >
> > I am new to apache community.
>
> Welcome :-)
>
> > I need to put rewrite rule in such a way that http://community.brand.com
> > should end up at
> > http://community.brand.com/base/index.jspa.
>
> This rather depends on what you mean by 'end up at'. If you wish the
> client to see the new address, then:
>
> # This requires a recent version of apache. If using an older major
> version,
> # specify the second argument in full
> RedirectMatch ^/$ /base/index.jspa
>
> On the other hand if you want the client to see only '/'
>
> RewriteEngine On
> RewriteRule ^/$ /base/index.jspa
>
> Note that this assumes you're using the main server config and putting
> the rules in a VirtualHost block directly. If you're forced to use
> htaccess, then read:
>
> http://wiki.apache.org/httpd/RewriteContext
>
> hth,
> --
> noodl
>
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] ReWrite Rule

Posted by Vincent Bray <no...@gmail.com>.
On 09/08/07, Lalit Kapoor <la...@gmail.com> wrote:
> Hello,
>
> I am new to apache community.

Welcome :-)

> I need to put rewrite rule in such a way that http://community.brand.com
> should end up at
> http://community.brand.com/base/index.jspa.

This rather depends on what you mean by 'end up at'. If you wish the
client to see the new address, then:

# This requires a recent version of apache. If using an older major version,
# specify the second argument in full
RedirectMatch ^/$ /base/index.jspa

On the other hand if you want the client to see only '/'

RewriteEngine On
RewriteRule ^/$ /base/index.jspa

Note that this assumes you're using the main server config and putting
the rules in a VirtualHost block directly. If you're forced to use
htaccess, then read:

http://wiki.apache.org/httpd/RewriteContext

hth,
-- 
noodl

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org