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 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题