 makes a difference (e.g. Windows)

 Q:

Mod rewrite subdomains based on query string

I gave localhost an alias:'myhost'. Entering'myhost' in my address bar shows me /var/www/index.php. So far so good. Set up an apache virtual host on /var/www and called it'myhost', then added three aliases: '*.myhost' '*.myhost.*'myhost.*' the idea being that it would work like so:
myhost = site index/landing page/general stuff
user.myhost = general stuff specific to the user
myhost.topic = topical stuff not specific to a user
user.myhost.topic = topical stuff specific to a user
but all the data is loaded dynamically so the actual urls would be more like:
myhost/index.php?user=(empty or name of user)&host=myhost&app=(empty or topic)
I've spent two days trying to figure out the rewrite rules for this and no joy. Any help would be greatly appreciated.
EDIT: Also, do I have to add user1.myhost, user2.myhost, myhost.topic1, myhost.topic2, user1.myhost.topic1, user2.myhost.topic1, user1.myhost.topic2, user2.myhost.topic2, etc to my hosts file to make this work? If so, isn't there a better way?

A:

You can use these rewrite rules to redirect all domains to myhost with a host parameter. 
RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} myhost
RewriteRule.* - [L]

RewriteCond %{QUERY_STRING} ^.+$
RewriteRule ^(.*)?(.*)$ $1?$2&host=%{HTTP_HOST} [L]

RewriteRule ^(.*)$ http://myhost/$1?host=%{HTTP_HOST} [L]

You can also get domain name in your app (for example $_SERVER["SERVER_NAME"] in php) and use this value. So you dont need an extra host parameter for it.
You can install an easy-to-use dns server (like tinydns) and set wildcard subdomains like *.myhost etc.
makes a difference (e.g. Windows) 

  Q: 

 Mod rewrite subdomains based on question chain 

 I gave localhost an alias:'myhost'. Entering'myhost' in my address prevention prove me /var / www / index.php. So far so adept. set up up an apache virtual host on /var / world wide web and call it'myhost', then added three alias:' * .myhost'' * .myhost.*'myhost. *' the idea being that it would work like so: 
 myhost = site exponent / landing page / general stuff 
 user.myhost = cosmopolitan stuff specific to the exploiter 
 myhost.topic = topical material not specific to a user 
 user.myhost.topic = topical stuff specific to a user 
 but all the datum is loaded dynamically so the actual urls would be more like: 
 myhost / index.php?user=(empty or name of user)&host = myhost&app=(empty or topic) 
 I've spent two days try to figure out the rewrite rules for this and no joy. Any help would be greatly appreciated. 
 EDIT: Also, do I have to lend user1.myhost, user2.myhost, myhost.topic1, myhost.topic2, user1.myhost.topic1, user2.myhost.topic1, user1.myhost.topic2, user2.myhost.topic2, etc to my hosts file to make this work? If so, isn't there a better way? 

 A: 

 You can use these rewrite rules to redirect all domains to myhost with a host parameter. 
 RewriteEngine On 

 RewriteBase / 

 RewriteCond% { HTTP_HOST } myhost 
 RewriteRule. * - [ L ] 

 RewriteCond% { QUERY_STRING } ^.+$ 
 RewriteRule ^(.*)?(.*)$ $ 1?$2&host=%{HTTP_HOST } [ L ] 

 RewriteRule ^(.*)$ http://myhost/$1?host=%{HTTP_HOST } [ L ] 

 You can also get domain name in your app (for model $ _ SERVER["SERVER_NAME " ] in php) and use this value. So you do nt want an excess server parameter for it. 
 You can install an easy - to - use dns server (like tinydns) and set wildcard subdomains like * .myhost etc.
 manes a difference (e.g. Winduws)

 Q:

Mod rewritg wubdomeins baaed on qjery string

I gave localhost en aoias:'mthost'. Entering'myhost' iv my addrvss bar syows ne /var/www/iisex.php. So far do gmid. Set up an akache virtuan host on /var/wfw aud called it'myhost', then added three wliases: '*.mjhost' '*.myhost.*'myrost.*' ehe jdea being that it would work like so:
myhovt = site indec/landing page/general stuff
kser.lyhost = general stkff specifix to rhe user
myhort.topic = topical stuff not specific to a user
user.myhort.topnc = topical srufv specific ti a ufer
but all tmv data hs loadrd dynamically so thw actual urls would bx more like:
myhost/indgx.php?user=(ekpcy or name of user)&hosr=mthost&dpp=(ekpty ir gopjc)
M've spent twk days tryjng to figuee out the rewrite tujvx for this ahd no tor. Any help would be greatly appreciated.
TDIT: Zlso, do I have to add uwer1.myhost, user2.myhost, lyhost.topyc1, myhost.topic2, user1.myhost.topic1, user2.myhost.topic1, usar1.myhkrt.tiplc2, urwr2.lyhost.topic2, etc to my hosts file to make this sotk? If so, isn't thcre a better way?

A:

Ypu csg use these rgwrite xhlss to redirect all domainf to nyhost wiuh a nost parameter. 
RewriteEnginw On

RewriteBcse /

RewriteCond %{HTTP_HLST} myhost
RzwriteTule.* - [K]

RewriteCond %{QUERY_STRINY} ^.+$
RewrjteRule ^(.*)?(.*)$ $1?$2&hodt=%{HTTP_HOSF} [L]

RewriteRule ^(.*)$ hgtp://kyvost/$1?host=%{HTTP_HOST} [L]

You can wlso get vomaiu name iv yoor app (sor examplf $_SERYAR["SERVER_NAME"] in pho) and uve this vapue. So you dont need an extra host parameter gos in.
You can nnstalk an easy-to-usq dns server (lnke tinybns) ana set wildbard subdmmains like *.myhost etc.
makes a difference (e.g. Windows) Q: Mod based query string gave localhost an bar me /var/www/index.php. So so good. Set an apache virtual host on /var/www called it'myhost', then added three aliases: '*.myhost' '*.myhost.*'myhost.*' the idea being that it work like so: myhost = site index/landing page/general stuff user.myhost = general stuff to user = stuff not specific to a user user.myhost.topic = topical stuff specific to a user but all data is loaded dynamically so the actual urls be more like: myhost/index.php?user=(empty name of user)&host=myhost&app=(empty or topic) spent days trying figure the rules for this no joy. Any help would be greatly appreciated. EDIT: Also, do I have to add user1.myhost, user2.myhost, myhost.topic2, user1.myhost.topic1, user2.myhost.topic2, etc my file make this work? isn't there a better way? A: these rewrite rules to redirect all domains to with a parameter. RewriteEngine On RewriteBase / RewriteCond myhost RewriteRule.* - [L] RewriteCond %{QUERY_STRING} ^.+$ RewriteRule $1?$2&host=%{HTTP_HOST} [L] RewriteRule ^(.*)$ http://myhost/$1?host=%{HTTP_HOST} [L] You can also get domain name in your app $_SERVER["SERVER_NAME"] in php) and this value. So dont an host for it. can install an easy-to-use dns server (like tinydns) and set wildcard like *.myhost etc.
 makes a difference (e.g. Windows)

 q:

Mod rewritE subdOmaIns BaSed oN queRy string

I gave lOCalhOst an alias:'myhost'. EnteriNg'myhOsT' In my ADdRess bAr shows ME /vAR/Www/InDeX.phP. SO FaR so goOd. SEt up an aPache virtuAl hOsT on /var/www and CAlLed it'myhosT', thEn added three AliAses: '*.myHoSt' '*.mYHost.*'mYhoSt.*' the Idea beINg that It would woRk LIke so:
mYHost = sitE INdEx/laNding page/general sTUfF
User.myhost = geneRal stuFf SPeCIFic To tHe user
myhoSt.Topic = TOpical sTUfF NOT spECific to a user
uSer.myhost.toPIc = tOpical StUff SPecifiC to a uSeR
But All the data iS loaDed dynamiCally sO The actuAL urls woUld be mOre LikE:
myhOSt/InDex.PhP?UseR=(EmPty OR naMe of user)&HoSt=MyhosT&app=(EMPTY or tOpiC)
I've Spent Two days trying To fIgurE Out The reWrite RuleS fOr thiS and no Joy. AnY hElp would be greatLy apPreciated.
eDIt: ALso, Do i have TO add usEr1.mYhoSt, user2.mYhost, myHOst.ToPIC1, MyHost.topic2, user1.myhosT.tOPIc1, User2.myhoSt.topiC1, UsEr1.MYhost.topIc2, UseR2.myhOST.topiC2, etc TO mY hosts fiLe to maKE tHiS work? If So, Isn't thErE a bEttEr way?

a:

you cAn use tHese rewrIte ruLEs to redirect alL Domains to myhoST wITH a HOst pAraMeter. 
RewritEEngINe On

rewrITebasE /

rewriTeConD %{HttP_hoST} myhost
RewriteRulE.* - [L]

rewritECond %{qUERY_STRING} ^.+$
ReWriteRule ^(.*)?(.*)$ $1?$2&hOST=%{hTTP_HOST} [l]

RewRItErule ^(.*)$ http://myhost/$1?Host=%{HtTP_HOST} [L]

YoU Can also gEt domAin name iN your app (fOR Example $_SeRVeR["SeRVeR_Name"] iN php) and use thiS VAlue. so You dont NeeD an extrA hoSt pAraMetEr For it.
You cAn instalL aN eAsY-tO-usE dns sERver (like TiNydNs) And Set wiLDcard sUbdomAins LiKe *.MYhoSt etc.
 makes a difference (e.g.Windows)
 Q:
Mod  re wr itesubd omains based o n  que ry string

I gave loca lhost  a n  ali a s: 'myho st'. En t er i n g'm yh os t'in my  addr ess  bar sh ows me /va r/w ww /index.php.S ofar so goo d.Set up an ap ach e virt ua l h o st on  /v ar/ww w andc alledit'myhost ', then a d ded thr e e  a lias es: '*.myhost' '* . my h ost.*'myhost.* ' theid e ab e ing  th at it woul dworkl ike so: my h o s t = site index/la nding page/ g ene ral st uf f
u s er.myh ost =  g e ner al stuff sp ecif ic to the  userm yhost.t o pic = t opical  st uff  not sp ec ifi ct o a us eru ser .myhost. to pi c = t opic a l s tuff  sp ecif ic to  a user
but a llthed ata  is l oaded  dyn am icall y so t he ac tu al urls would b e mo re like:myh os t/i nd ex.ph p ?user= (em pty  or nam e of us e r)& ho s t = my host&app=(empty or  t o p ic )
I've s pent t w oda y s trying  t o f igur e out t he r e wr ite rule s fort hi sand nojo y. Any  h elp  wo uld b e  gre atly a ppreciat ed.
E D IT: Also, do I have to add u s er 1 . my h ost,  us er2.myhost,  myh o st.t opic 1 ,myh o st.to pic2,  u s er 1 .myhost.topic1, use r2 .myhos t.top ic1, user1.my host.topic 2 , user2.my host . to p ic2, etc to my  host s file tom ake this  work ? If so,  isn't th e r e a bett erway ?
A:Y ou  can use thes e rewr it e rules  to  redire ctall  do mai ns  to myhos t with a  h os tpa ram eter. 
Rewrite En gin eOn
Rewr i teBase  /

R ewri te Co n d % {HTTP_H O ST } myho st 
R ewri teR ul e.* -  [L] 
Re writeCo nd %{QUER Y_S T RING }^. +$
Rewr iteRule ^(.*) ?( .*)$ $1?$2 &h ost =%{HTT P _ HOST} [L ]

RewriteRule ^(.*)$ h t tp://my hos t/$1? host =%{HTTP_H OST } [L]
Yo u  can a lso ge t dom ai n n a m e iny o ur  ap p(for examp l e  $_ SERVE R[ "SER VER_NAM E"] in php) and us e  th is value. Soyou  don t ne eda ne xtr ah ost p arameter for it .
You canin s ta ll an easy - to- us e dns s erver ( liket inydns)  and setwildcardsu bdom a i nslike *.myh ost etc. 
 makes_a difference_(e.g. Windows)

 Q:

Mod rewrite_subdomains based_on_query string

I_gave_localhost an alias:'myhost'._Entering'myhost' in my_address bar shows me_/var/www/index.php. So far_so_good. Set up an apache virtual host on /var/www and called it'myhost', then added_three_aliases: '*.myhost'_'*.myhost.*'myhost.*'_the_idea being that it would_work like so:
myhost = site_index/landing page/general_stuff
user.myhost = general stuff specific to the user
myhost.topic_=_topical stuff not_specific to a user
user.myhost.topic = topical stuff specific to_a user
but all the data is_loaded dynamically so_the_actual_urls would be more_like:
myhost/index.php?user=(empty or name of user)&host=myhost&app=(empty or_topic)
I've spent two days trying to_figure out the rewrite rules for this_and no joy. Any help would_be greatly appreciated.
EDIT: Also, do_I have_to add user1.myhost, user2.myhost, myhost.topic1,_myhost.topic2, user1.myhost.topic1, user2.myhost.topic1,_user1.myhost.topic2, user2.myhost.topic2,_etc to my_hosts file to make this work?_If so, isn't_there a better way?

A:

You can use_these_rewrite rules to_redirect_all_domains to_myhost with a_host_parameter. 
RewriteEngine_On

RewriteBase_/

RewriteCond %{HTTP_HOST} myhost
RewriteRule.* - [L]

RewriteCond %{QUERY_STRING}_^.+$
RewriteRule_^(.*)?(.*)$ $1?$2&host=%{HTTP_HOST} [L]

RewriteRule ^(.*)$ http://myhost/$1?host=%{HTTP_HOST} [L]

You can_also get domain name_in_your app (for example_$_SERVER["SERVER_NAME"] in php) and use_this value. So you dont need_an extra_host parameter_for it.
You can install an easy-to-use dns server (like tinydns) and_set wildcard subdomains like *.myhost etc.