Page 1 of 1

[SOLVED] YAMRQ (Yet Another mod_rewrite Question)

Posted: Tue Mar 14, 2006 6:26 pm
by evilmonkey
Hey everyone,

I am trying to forward xxx.tmeet.com ==> tmeet.com/fwd.php?username=xxx. Behold my might .htaccess file:

Code: Select all

php_flag register_globals off
RewriteEngine on
RewriteRule ^([^/.]+).tmeet.com/?$ fwd.php?username=$1 [L]
But it isn't working =( All the subdomains point to the root, that has been taken care of. But xxx.tmeet.com still goes to index.html instead of to that script. Can someone tell me why and hint at how to correct this issue?

Thanks!

Posted: Tue Mar 14, 2006 6:30 pm
by redmonkey
You've already asked this question, and I've already given you the answer.

Posted: Tue Mar 14, 2006 6:52 pm
by evilmonkey
I will die of embaressment one of these days. That's what happens when you don't immediately impliment an offered solution. However, the solution you gave me in the orther thread does a 500 error on me (I though that was impossible if I'm with a hosting company). The code is below:

Code: Select all

php_flag register_globals off
RewriteEngine on
RewriteCond   %{HTTP_HOST}        !^www\.
RewriteRule   ^(.+)               %{HTTP_HOST}          [C]
RewriteRule   ([^.]+)\.tmeet\.com  /fwd.php?username=$1
Thanks redmonkey, sorry for being a moron.

Posted: Tue Mar 14, 2006 6:55 pm
by evilmonkey
I fixed the problem. Code below.

Code: Select all

php_flag register_globals off
RewriteEngine on
RewriteCond   %{HTTP_HOST}        !^www\.
RewriteRule   ^(.+)               %{HTTP_HOST}          [C]
RewriteRule   ([^.]+)\.tmeet\.com$ fwd.php?username=$1
($ was missing)

Thanks. :)