httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Naveen Sharma" <mailatnav...@gmail.com>
Subject Re: [users@httpd] Maintaing the URL when Rewriting
Date Thu, 12 Jul 2007 13:57:38 GMT
Hi Scott,


I want the URL to be visible as
http://dev.home.en/hawaii-hotels but internally it should use
http://dev.home.en/action?city=hawaii.

I have used this
RewriteEngine On
 RewriteRule ^/([a-zA-Z]*)(-)(hotels)/ http://%{HTTP_HOST}/action?city=$1

This changes the URl to
http://dev.expedia.jp/action.do?city=hawaii

Please suggest as to how this URL can be preserve while internally hiting an
action.

Thanks,
Navin


On 7/12/07, Scott Wilcox <sc0tt@x0f.org> wrote:
>
> I think you need to be a little more specific in your request. Do you
> mean that you want the internally processed URL to remain the same, or
> the URL that the end user is seeing?
>
> If its the latter, then Martijn's example does that fine.
>
> Scott.
>
> Naveen Sharma wrote:
> > I have tried this but this is changing the URL.The initial URL gets
> > modified.
> >
> >
> >
> > On 7/12/07, *Martijn* <sweetwatergeek@googlemail.com
> > <mailto:sweetwatergeek@googlemail.com>> wrote:
> >
> >     > I have a URL of this form
> >     > http://dev.home.en/hawaii-hotels <http://dev.home.en/hawaii-hotels
> >
> >     > I want to redirect it to
> >     > http://dev.home.en/action?city=hawaii
> >     >
> >     > without actually modifying the
> >     > URL which is( http://dev.home.en/hawaii-hotels).
> >     >
> >     > Please let me know if this can be done using Apache hhpd.conf
> >     without
> >     > modifying the initial URL.
> >
> >     RewriteEngine on
> >     RewriteRule /(.*)-hotels$ /action?city=$1
> >
> >     Should work (though I didn't test it).
> >
> >     See also, depending on your Apache version:
> >     http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
> >     <http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html>
> >     or
> >     http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
> >
> >     Martijn
> >
> >
> ---------------------------------------------------------------------
> >     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
> >     <mailto:users-unsubscribe@httpd.apache.org>
> >       "   from the digest: users-digest-unsubscribe@httpd.apache.org
> >     <mailto:users-digest-unsubscribe@httpd.apache.org>
> >     For additional commands, e-mail: users-help@httpd.apache.org
> >     <mailto:users-help@httpd.apache.org>
> >
> >
>
> ---------------------------------------------------------------------
> 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
>
>

Mime
View raw message