.htaccess重定向和路径逻辑
我在将一些旧URL重定向到新位置时遇到问题 这些问题涉及如下URL:.htaccess重定向和路径逻辑,.htaccess,redirect,alias,mod-alias,.htaccess,Redirect,Alias,Mod Alias,我在将一些旧URL重定向到新位置时遇到问题 这些问题涉及如下URL: 1) RedirectMatch permanent THISWORD-THIS-WORD.html http://domain.com/somecategory/newurl-for-this-page.html 2) RedirectMatch permanent someurl-THISWORD-THIS-WORD.html http://domain.com 3) RedirectMatch perman
1) RedirectMatch permanent THISWORD-THIS-WORD.html http://domain.com/somecategory/newurl-for-this-page.html
2) RedirectMatch permanent someurl-THISWORD-THIS-WORD.html http://domain.com
3) RedirectMatch permanent anotherurl-THISWORD-THIS-WORD.html http://domain.com/new-anotherurl.html
问题是:
重定向第一个url(1)将导致第二个和第三个url(2和3)重定向到1)重定向(即)
我想了解为什么第二条和第三条遵循第一条指令
临时解决办法是放弃第一次重定向。因此,当cleint请求旧url 1时,他们将得到404错误
有没有办法通过.htaccess解决这个问题
为什么会这样
拥有3个以相同路径结尾的URL的逻辑是什么
i、 e
oneword-THIS-PATH.html
twoword-THIS-PATH.html
thrreword-THIS-PATH.html
正在从同一.htaccess文件重定向的
谢谢我不使用重定向匹配 试试这个
RewriteCond %{REQUEST_URI} ^.*/THISWORD-THIS-WORD.html
RewriteRule ^http://domain.com/somecategory/newurl-for-this-page.html [R=301,L]
RewriteCond %{REQUEST_URI} ^.*/someurl-THISWORD-THIS-WORD.html
RewriteRule ^http://domain.com [R=301,L]
RewriteCond %{REQUEST_URI} ^.*/anotherurl-THISWORD-THIS-WORD.html
RewriteRule ^http://domain.com/new-anotherurl.html [R=301,L]
我得到一个404错误,也许我在服务器中丢失了一些mod?