URL中的Joomla与htaccess的重写 [英] url rewriting in joomla with htaccess
本文介绍了URL中的Joomla与htaccess的重写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的Joomla的网址是:
的http://sitename.com/index.php/search/door?slug=101-jessica-alba-202
和使其URL如:
的http:// 10 - 杰西卡 - 阿尔巴-194 .sitename.com /
那么,什么是这个的.htaccess规则。 ??
我试图
的RewriteCond%{HTTP_HOST} ^(([0-9] +) - (*) - ([0-9] +))。\网站名称\ .COM $
重写规则^ $的index.php选项= com_name和放大器;查看=视图名和放大器;塞=%1
解决方案
有需要按顺序执行多个步骤来完成你想要的:
- 您需要在您的域名启用通配符子域(这可以通过的cPanel做)
- 您将需要修改相应的路由器文件解析URL的第一部分(而不是最后一部分)。
- 您将需要添加相应的条目中的.htaccess文件。
所以,它只是不只是一个.htaccess的修改,将你想要做什么。
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
解决方案
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.
这篇关于URL中的Joomla与htaccess的重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文