重写规则在 joomla htaccess 上不起作用
我需要从 http://www.mysite.com/passport/365.html 到 http://www.mysite.com/passport/365.html?task =查看
我尝试这样做 RewriteCond %{HTTP_HOST} ^/passport/365.html$ RewriteRule ^/?$ /passport/365.html?task=view [QSA]
但它不起作用。
请帮忙。
I need a redirect from http://www.mysite.com/passport/365.html to http://www.mysite.com/passport/365.html?task=view
I try to do it like this
RewriteCond %{HTTP_HOST} ^/passport/365.html$
RewriteRule ^/?$ /passport/365.html?task=view [QSA]
and it doesn't work.
Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试一下:
我认为在你的例子中你缺少 **
所以它应该是这样的:
try that :
I think in you example ur missing the **
so it should be something like :
我建议您使用这个插件。
您只需将重定向规则添加到插件中即可,无需修改 .htaccess
I would recommend you use this plugin.
You can simply add the redirect rule to the plugin without modifying .htaccess
Joomla 中已经内置了一个名为“redirect”的组件,您可以在其中设置重定向,因此您根本不必使用 .htaccess。
这是一个很好的教程: http://www.joomtraining .com.au/tutorials/joomla-1.6/creating-a-page-redirect
.htaccess 的问题是每个重定向都必须设置在文件中的适当位置。
There is a component already build in Joomla called "redirect" where U can set-up your redirects, so you don't have to use .htaccess at all.
Here is a good tutorial: http://www.joomtraining.com.au/tutorials/joomla-1.6/creating-a-page-redirect
The problem with the .htaccess is that every redirect must be set in appropriate place in the file.