|
rewrite url for subdomain (joomla)
hi, i need your help, and there is the problem
1. i want to have virtual subdomain like subdomain.example.com
2. the true url that i want to rewrite is
http://example.com/index.php?option=com_content&view=article&id=73&Itemid=267&toko=subdomain
3. i have activated joomla SEF so i got new url, like
http://example.com/toko-user?toko=subdomain
4. i want htaccess to rewrite that url (no.3) to something like this
http: //subdomain.example.com
5. the code that i put in htaccess is
########## Begin - Custom subdomain
RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.com [NC]
RewriteCond %1 !^www$ [NC]
RewriteRule ^(.*)$ http://example.com/toko-user?toko=%1 [L]
########## End - Custom subdomain
if i write url in address bar like http: //subdomain.example.com
i got the page that i want, but the url in address bar change to
http://example.com/toko-user?toko=subdomain (redirecting) and what i want is not that, but rewrite
but if i change the script to
RewriteRule ^(.*)$ /toko-user?toko=%1 [L]
i got internal server error (500)
can you tell me what is wrong with my code?
best regards
|