Re: Maintaing the URL when Rewriting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have tried this but this is changing the URL.The initial URL gets modified.


 
On 7/12/07, Martijn <sweetwatergeek@xxxxxxxxxxxxxx> wrote:
> I have a URL of this form
> 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
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@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux