gpt4 book ai didi

php - joomla .htaccess 中的重写规则不起作用

转载 作者:可可西里 更新时间:2023-11-01 01:15:48 25 4
gpt4 key购买 nike

我在 joomla .htaccess 中添加了这一行以删除部分 url。

原始 URL 示例 - http://odishayellowpages.in/item/scientific-suppliers

必需的 URL 示例 - http://odishayellowpages.in/scientific-suppliers

我已经使用了这个重写规则 - 但它没有任何区别。

# Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
RewriteRule ^item/(.*)$ $1 [R=301,L]
## End - Custom redirects

最佳答案

您可以在 RewriteEngine On 行下方使用此重定向规则:

RewriteRule ^item/(.*)$ /$1 [R=301,L,NC,NE]

您需要在目标 URL 的开头使用 / 以避免它被附加到当前文件系统路径。

关于php - joomla .htaccess 中的重写规则不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39142710/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com