我在 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/