【问题标题】:How to pass multiple parameters in .htaccess file in codeigniter如何在codeigniter的.htaccess文件中传递多个参数
【发布时间】:2020-12-27 23:56:51
【问题描述】:

我有要重定向的 URL 301 。 旧 URL 应重定向到新 URL。

示例 - https://www.dummy.com/service-centers/Rajasthan/Kekri/Riico-Industrial-Area/Riico-Industrial-Area--Shoes-Factory/Ekam-Motors/370 - 旧网址

https://www.dummy.com/service-centers/Kekri/Ekam-Motors/370 - 新网址

我一直在尝试使用下面的 .htaccess 来完成这项工作,但我最终得到了这个

redirect 301 /service-centers/$2/$3/$4/$5/$6/$1  /car-service-centers/$3/$6/$1

但它不起作用,请帮帮我

【问题讨论】:

    标签: php .htaccess codeigniter


    【解决方案1】:

    第一个参数应该是一个正则表达式,应该这样做。

    redirect 301 /service-centers/([0-9A-Za-z-_]+)/([0-9A-Za-z-_]+)/([0-9A-Za-z-_]+)/([0-9A-Za-z-_]+)/([0-9A-Za-z-_]+)/([0-9A-Za-z-_]+)  /car-service-centers/$2/$5/$6
    

    【讨论】:

    • 它没有重定向到新的 URL
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-21
    相关资源
    最近更新 更多