Regex htaccess结合了特定和常规重定向问题

Regex htaccess结合了特定和常规重定向问题,regex,apache,.htaccess,mod-rewrite,Regex,Apache,.htaccess,Mod Rewrite,将域从ExampleShop.com更改为ExampleStore.com 我在尝试重定向大约30个特定页面时遇到了一个问题,并且对URL映射没有改变的页面进行了一次通用重定向,只改变了域 这就是我所拥有的,它使用通用重写规则重定向所有内容,而不是重定向特定重写 Options +FollowSymLinks RewriteEngine on #Specialty Rewrites for non-exact mapped URLs RewriteRule ^/gifts/jewellery/

将域从ExampleShop.com更改为ExampleStore.com

我在尝试重定向大约30个特定页面时遇到了一个问题,并且对URL映射没有改变的页面进行了一次通用重定向,只改变了域

这就是我所拥有的,它使用通用重写规则重定向所有内容,而不是重定向特定重写

Options +FollowSymLinks
RewriteEngine on

#Specialty Rewrites for non-exact mapped URLs
RewriteRule ^/gifts/jewellery/bracelets.html$ http://www.ExampleStore.com/gifts/jewellery/bracelets.html [R=301,L]

RewriteRule ^/gifts/watches/banded.html$ http://www.ExampleStore.com/gifts-for-him/jewellery/watches.html [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

#Generic Rewrite for exact mapped URLs
RewriteRule ^(.*)$ http://www.ExampleStore.com/$1 [R=301]
删除前导斜杠:

RewriteRule ^gifts/jewellery/bracelets.html$ http://www.ExampleStore.com/gifts/jewellery/bracelets.html [R=301,L]

RewriteRule ^gifts/watches/banded.html$ http://www.ExampleStore.com/gifts-for-him/jewellery/watches.html [R=301,L]

.htaccess
是每个目录指令,Apache在
重写规则
中使用时会从URI中删除前导斜杠,谢谢!我完全忽略了这一点!