httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: [users@httpd] hide a URL
Date Mon, 15 Sep 2008 21:07:59 GMT
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@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