You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Rodrigo Correa de Paiva <ro...@gmail.com> on 2008/09/15 22:33:02 UTC
[users@httpd] hide a URL
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
Re: [users@httpd] hide a URL
Posted by Krist van Besien <kr...@gmail.com>.
On Mon, Sep 15, 2008 at 10:33 PM, Rodrigo Correa de Paiva
<ro...@gmail.com> 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
So the user enters the url "www.exemple.com/community/begin.do", but
gets the resource located at /site/community/begin.do.
Is that what you want?
Probably easiest is to change the documentroot and add "site" to it.
You can also use "Alias".
eg.
Alias /community /site/community
And you can use rewrite rules. But rewrite rules are really meant for
cases where alias will not do...
Krist
--
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?
---------------------------------------------------------------------
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] hide a URL
Posted by André Warnier <aw...@ice-sa.com>.
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
Re: [users@httpd] hide a URL
Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 15.09.08 17:33, Rodrigo Correa de Paiva wrote:
> I need to hide part of a url.
hide where?
> 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?
--
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Linux IS user friendly, it's just selective who its friends are...
---------------------------------------------------------------------
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