我想将residential-property/20/old_value
重定向到/residential-properties/new_value
,因为我在.htaccess文件中编写了代码:
RewriteEngine On
RewriteBase /
RewriteRule ^residential-property/20/old_value?$ /residential-properties/new_value? [B,NE,R=301,L,NC]
# Remove trailing slashes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ $1/ [R=301,L]
# Actually 301 direct all index.php requests
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,L]
# this gets rid of index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
上面的代码重定向旧网址,但它还添加?在像https://example.com.com/?/residential-properties/new_value/
这样的网址中,我不想在网址中添加该问题我的错误请帮助我。提前谢谢。