You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Witham, Darren (Contractor)" <wi...@bp.com> on 2003/07/15 15:26:34 UTC

[users@httpd] Simple mod-rewrite

Hi,

  This is a simple mod_rewrite question but I have tried numerous
combinations of mod-rewrite rules/conditions and am having no joy.

  Users usually access my app via https://hostname/xyz/initial.jsp (xyz path
passes to weblogic handler)

  I wish to use mod-rewite to call the above page even if they just attempt
to access the app via https://hostname i.e I don't want a directory listing
of the Apache document root. I have solved this using a simple HTML file
that does a redirect but wanted to remove the need for this and use
mod_rewrite.

  I have tried all sorts of combinations like 

  RewriteRule / /xyz/initial.jsp 
  RewriteRule /\// \/xyz\/initial.jsp
  RewriteRule \/ \/xyz\/initial.jsp

  and they all come back with a bad request error


  My httpd.conf file is slightly more involved than a standard one as we use
SSL and compression which don't seem to like each other so we have split out
into virtual hosts but to start with I would be grateful if someone could
just tell me how to simply define the rule/condition to rewrite a request
for the document root to /xyz/initial.jsp and then I can worry about whether
the other bits of httpd.conf file are causing something to fail.

Thx
  

---------------------------------------------------------------------
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] Simple mod-rewrite

Posted by Robert Andersson <ro...@profundis.nu>.
Witham, Darren (Contractor) wrote:
>   I wish to use mod-rewite to call the above page even if they just
> attempt to access the app via https://hostname i.e I don't want a
> directory listing of the Apache document root.

Perhaps I'm a bit tired, but I would guess that this does the job:

    RedirectMatch  ^/$ https://hostname/xyz/initial.jsp

Regards,
Robert Andersson


---------------------------------------------------------------------
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