问题
my joomla url is :
http://sitename.com/index.php/search/door?slug=101-jessica-alba-202
and make it to url like :
http://10-jessica-alba-194.sitename.com/
so what is the .htaccess rule for this. ??
i tried
RewriteCond %{HTTP_HOST} ^(([0-9]+)-(.*)-([0-9]+))\.sitename\.com$
RewriteRule ^$ index.php?option=com_name&view=viewname&slug=%1
回答1:
There are multiple steps that need to be done in order to accomplish what you want:
- You will need to enable wildcard subdomains on your domain (this can be done via cPanel)
- You will need to modify the appropriate router file to parse the first part of the URL (and not the last part).
- You will need to add the appropriate entries in the .htaccess file.
So, it's just not only an .htaccess modification that will do what you want.
来源:https://stackoverflow.com/questions/28404600/url-rewriting-in-joomla-with-htaccess