I am woundring how to rewrite
http://www.example.com/thread.php?id=100
to
http://t100.example.com/
???
after a hard search, I read this topic
http://forum.modrewrite.com/viewtopic.php?t=5744&highlight=rewrite+subdomain+variable
but couldn't find what i'm looking for.
AND I don't have access to httpd.conf to use virtual sub domains ( I belive this is not my problem actually ).
Is it possible to do that using htaccess only ?
to make something clear:
I made some preg_replace to the original output ( which prints the content of allthreads.php file ) and it's links appears like
http://t100.example.com/
http://t101.example.com/
http://t102.example.com/
http://t103.example.com/
http://t104.example.com/
exactly how i want it , BUT when I click any link there , I get 404 error.
I also tried this code in htaccess file :
- Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.example\.com$ [NC]
RewriteRule ^$ /?id=%1 [QSA,L]
It didn't work too.
I Know I'm a rookie, but you are the way to make me proffissional.
any help will be considered.
God bless you.