Re: hide a URL

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

 



Rodrigo Correa de Paiva wrote:
I need to hide part of a url.
for example:
www.exemple.com/site/community/begin.do
|| i need to hide the word "site"
v
www.exemple.com/community/begin.do


which the most appropriate way to do this?
mod_rewrite?
I do not know mod_rewrite, could someone give me a help about what to do?
Thanx

I'm a beginner with nod_rewrite too, but this seems a simple one, so let me try :

1) RewriteEngine on
2) RewriteLog /path-to-logfile
3) RewriteLogLevel 3
4) RewriteRule ^/site/(.*)$ /$1 [PT,L]

(Lines 2 and 3 so that you can follow what happens, in the named logfile. When it works, set RewriteLogLevel back to 0).

I did not include the "www.exemple.com" part, because that is not part of the URL. The "PT" flag is so that, if you later decide to alias /community to something else, it will still do it. The "L" flag is there to say that once that replacement is done, you don't want any other RewriteRule to do something else to the result.



André

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