FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » HTTP headers and header()
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: HTTP headers and header() [message #176740 is a reply to message #176642] Fri, 20 January 2012 15:34 Go to previous message
Miquel van Smoorenbur is currently offline  Miquel van Smoorenbur
Messages: 1
Registered: January 2012
Karma:
Junior Member
In article <d16b12f4-efb0-46e7-a585-a4c143c33818(at)a8g2000pbi(dot)googlegroups(dot)com>,
Sandman <enjoylife_95135(at)hotmail(dot)com> wrote:
> Upon redirection however, the location bar in my browser updates
> to example.com/user. Does anyone know if there is a way to:
>
> 1. Redirect the vanity domain to the user's profile.
> 2. Keep the location bar the same (i.e. vanity.user.com)

Sure. Use mod_rewrite, match on the Host header, and alias
to /user/

Say you want to map USER.vanity.com -> example.com/USER :

RewriteCond %{HTTP_HOST} ^(.*)\.vanity\.com$ [NC]
RewriteRule ^/(.*)$ /%1/$1

If you use this in a VirtualHost section make sure you
set ServerAlias *.vanity.com.

You might want to exclude /cgi-bin or other paths from this
specifically, you might want to add the [PT] flags to the
rewriterule .. see http://httpd.apache.org/docs/current/mod/mod_rewrite.html
for the details

Assuming apache, ofcourse.

Mike.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: error from phpadmin
Next Topic: list() Struktur auslagern
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Dec 01 00:28:51 GMT 2024

Total time taken to generate the page: 0.04081 seconds