简体   繁体   English

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

[英]Rewrite rule in joomla .htaccess not working

I have added this line in joomla .htaccess to remove part of the url. 我在joomla .htaccess中添加了这一行来删除部分网址。

Original URL Example - http://odishayellowpages.in/item/scientific-suppliers 原始网址示例 - http://odishayellowpages.in/item/scientific-suppliers

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

I have used this rewrite rule - but it doens't make any difference. 我已经使用了这个重写规则 - 但它没有任何区别。

# 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

You can use this redirect rule just below RewriteEngine On line: 您可以在RewriteEngine On正下方使用此重定向规则:

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

You need to use / at start of target URL to avoid it getting appended to current filesystem path. 您需要在目标URL的开头使用/以避免它被附加到当前文件系统路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM