dongqianwei6664 2017-10-04 09:50
浏览 71
已采纳

重写.htaccess文件中的特定URL而不是基于模式

I want to rewrite a single URL of my website (Joomla) to a friendly URL i.e.

www.example.com/index.php?option=com_mycomponent&view=article&id=10&nav_button=0&article_layout=1&Itemid=503

to

www.example.com/favourit

without disturbing the other URLs of the website

Thank you for your help.

  • 写回答

1条回答 默认 最新

  • dongyou4411 2017-10-04 09:57
    关注

    Original question:

    Try

    RewriteRule ^favourit$ /index.php?option=com_mycomponent&view=article&id=10&nav_button=0&article_layout=1&Itemid=503 [L]
    

    OP springs a sub folder..

    If you intend to move the site live, as example.com presumes your already live but your comment suggests your still working on localhost then you should.

    Put in the webroot thats / not /mysite

    RewriteRule ^mysite/favourit$ /mysite/index.php?option=com_mycomponent&view=article&id=10&nav_button=0&article_layout=1&Itemid=503 [L]
    

    This is temporary so you don't need to fix once you go live.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 第一天重装配置python和opencv后第二天打开就成这样,瞎捣鼓搞出来文件夹还是没法联网
  • ¥20 Arduino 循迹小车程序电路出错故障求解
  • ¥20 Arduino 循迹小车程序电路出错故障求解
  • ¥100 AT89C52单片机C语言调试之后再回答
  • ¥15 AT89C52单片机C语言串口助手发送数据包返回值
  • ¥15 C++数组中找第二小的数字程序纠错
  • ¥50 MATLAB APP 制作出现问题
  • ¥15 wannier复现图像时berry曲率极值点与高对称点严重偏移
  • ¥15 利用决策森林为什么会出现这样·的问题(关键词-情感分析)
  • ¥15 DispatcherServlet.noHandlerFound No mapping found for HTTP request with URI[/untitled30_war_e