Reply to Re: rewrite for sub-domains...

Your name:

Reply:


Posted by Kentor on 12/15/06 18:32

okok now it works with www. :)
so now i just need to understand whats the purpose of
RewriteCond %{REQUEST_FILENAME} !-d

because once i put this back, then montreal.mysite.com shows the page
of mysite.com again... and im afraid to take it out cuz this line has
been there before i started playing with sub-domains... so im afraid it
will mess up all my other normal redirects...

Rik wrote:
> Kentor wrote:
> > yay it finally started working :) but it works only if i use
> > http://montreal.mysite.com or montreal.mysite.com but if i use
> > www.montreal.mysite.com or http://www.montreal.mysite.com i still get
> > the main page of mysite.com... how can i fix this?
> >
> > i guess its this line... RewriteCond %{HTTP_HOST} !^www\.
> > but if i take it out then even the main page mysite.com points to my
> > searchform.php =/
>
> Ah, it's in the same dir as your normal site?
> Then I would change it to this:
>
> RewriteEngine On
> RewriteBase /
> RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.mysite\.com
> RewriteCond %{HTTP_HOST} !^www\.mysite\.com
> RewriteRule ^(.*)$ searchForm.php?location=%2&foo=$1 [L,QSA]
>
> #Note the change from %1 to %2!
>
> Grtz,
> --
> Rik Wasmus

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация