【问题标题】:htaccess redirect from small to capshtaccess 从小重定向到大写
【发布时间】:2013-01-28 18:19:50
【问题描述】:

有人可以建议,在 joomla 中面临很多重复 url 问题

A) 新闻部分面临的问题

 Correct url- www.xyz.com/?page=11&&option=com_latestnews&view=list&Itemid=25
 Wrong url-   www.xyz.com/?page=11&&option=com_latestnews&view=list&itemid=25

如果您在上面看到,在单词 Itemid 中,i 在错误的 url 中很小,在大写中 i 在正确的 url 中

B) 在新闻栏目中面临第二期

     Correct url- www.xyz.com/index.php?option=com_latestnews&view=detail&n_id=365&Itemid=10
     Incorrect url-  www.xyz.com/index.php?option=com_latestnews&view=detail&n_id=365&Itemid=25

如果您在上面看到,在单词 Itemid 中,正确的 url 是 10,但不正确的重复 url 是 25

如何通过 .htaccess 301 重定向创建的重复页面来纠正这个问题,任何建议都将是一个救星

谢谢

【问题讨论】:

    标签: .htaccess


    【解决方案1】:

    对于Itemid 中的I,您必须具体说明。然后对于所有重复的项目 ID,您必须明确指出。

    案例问题:

    RewriteCond %{QUERY_STRING} ^(.*)itemid=(.*)$
    RewriteRule ^(.*)$ /$1?%1Itemid=%2 [L,R=301]
    

    对于每个来自项目 ID:

    RewriteCond %{QUERY_STRING} ^(.*)&Itemid=25(&|$)(.*)$
    RewriteRule ^(.*)$ /$1?%1&Itemid=10&%3 [L,R=301]
    

    在这里,ID 25 被重定向到 10。您可以为其余的副本添加任何其他 ID。

    【讨论】:

      猜你喜欢
      • 2016-05-23
      • 1970-01-01
      • 2014-11-19
      • 1970-01-01
      • 2020-12-21
      • 2015-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多