httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Dessent <br...@dessent.net>
Subject Re: [users@httpd] What is the purpose or possible use of the @ in URL's
Date Mon, 05 Jan 2004 02:21:31 GMT
Arturo P wrote:

> I'm very curious as to the functionality of the @ in urls. I run a user
> supported website off Apache. And I'm curious if i could do something
> such as redurect a user to a specific path, such as
> http://username@domain.com would be redirected to
> http://users.domain.com/username.

The part in front of the @ represents the username for authentication. 
So it's not sent to Apache as part of the URL in the request.  You might
be able to do what you want with mod_rewrite by making a rule that
matches requests with that username.  But unless the page that is being
requested requires authentication the browser will not send a username
at all.  So in the case of a normal URL apache has no idea what's in
front of the @, just as everything in a URL after the '#' is meant to
refer to a specific anchor the page and is not sent by the browser
either.

YOu might be able to do what you want with a client-side javascript
hack, but it wouldn't be pretty.  You could have it check
document.location and see if it contains a username, and if so do a
redirect to the appropriate user page URL.  But the user would still be
fetching the first page and then reloading the new page after the
javascript executed.

Brian

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