You are here: Re: rewrite for sub-domains... « All PHP « IT news, forums, messages
Re: rewrite for sub-domains...

Posted by Rik on 12/15/06 16:56

Kentor wrote:
> Ok this is really strange... =/ nothing works.
>
> If i use the 3 lines you gave me:
>
> RewriteCond %{HTTP_HOST} ^([^.]+\).mywebsitehere.com
> RewriteCond %{HTTP_HOST} !^www\.
> RewriteRule ^(.*)$ searchForm.php?location=%1&foo=$1 [L,QSA]
>
> then my whole website is dead and i get this everywhere:

Internal Server Error is usually a syntax problem.

Let's try:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^([^.]+)\.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ searchForm.php?location=%1&foo=$1 [L,QSA]

It works here, using http://text.localhost/text.ext (which points to
http://blaat.localhost/:
---searchForm.php---
<?php var_dump($_REQUEST); ?>
--------------------
Output:

array(2) { ["location"]=> string(4) "test" ["foo"]=> string(8) "test.ext" }

Grtz,
--
Rik Wasmus

 

Navigation:

[Reply to this 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

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