I tried to make a .htacces to simulate dynamics subdomains. like his post : .htaccess: mod-rewrite; subdomain
but it's impossible for me to get the expected result.
i have read several times the doc at : apache
i have no problem with : RewriteCond, RewriteRule, regular expression. But i have problems with the subdomain.
i have this page : tododiversion.es and for my example, I want this :
chr.tododiversion.es ==> tododiversion.es/chr/
i put .htaccess in the www folder: www/ .htaccess
and the folder "chr" is in : www/chr/
in the htacces i put :
RewriteEngine On
# host starts with something else
RewriteCond %{HTTP_HOST} ^([^\.]+)\.tododiversion\.es$ [NC]
# rewrite
RewriteRule ^(.*)$ /chr [L]
it doesn't work..
I know that urlrewritting is working because I made a simple test. I know that RewriteCond is working because I made a simple test. I was trying on my computer with localhost and 127.0.01 and it didn't work neither.
If someone could give me some advice it should be great! Chris