GG資源網

WordPress重定向錯誤

問題描述:

I\'m currently using WordPress 4.8 with permalink structure of https://www.example.com/%category%/%postname%/. I also use Redirection plugin. After awhile, I decided to move my wordpress installation from Root to Subdirectory using this tutorial from official wordpress.org. I followed exactly like first method. It works but from time to time I receive a lot of 404 error log in Redirection plugin log and Google Search Console log.

I created subdirectory for wordpress using same name with domain name. Assume my domain is https://www.example.com. I created subdirectory name of www.example.com. Reason because I have multiple addon domains which I installed wordpress in similar way. Only this main domain have problem.

PROBLEM:
I often receive 404 errors log in Redirection plugin log and Google Search Console. Assume I have a page of overflow then my URL error look like this https://www.example.com/www.example.com/category/overflow/ instead of https://www.example.com/category/overflow/ and this is happened everyday on many URL\'s even newer posts. With exception of my index.php where my https://www.example.com/www.example.com/index.php always redirect to https://www.example.com/ without any problem and no error logs.

.HTACCESS on Root

.HTACCESS on Subdirectory

QUESTION:
How do I add a wildcard redirects which will redirect anything matching condition www.example.com/www.example.com to www.example.com

For example:

  1. https://www.example.com/www.example.com/pageA/ to https://www.example.com/pageA/
  2. https://www.example.com/www.example.com/Category1/pageB/ to https://www.example.com/Category1/pageB/
  3. https://www.example.com/www.example.com/Category2/pageC/ to https://www.example.com/Category2/pageC/ and so on.

I\'ll be honest. I do know how to redirect oldPage to newPage but seems this is out of my knowledge. I tried many tutorial on google and redirect generator etc but still I receive 404 error logs of that kind. Please help me. Thank in advance.

網友觀點:

You can try this plugin 301 redirect. it is useful to redirection old URL to new URL

由於網站搬家,部分鏈接失效,如無法下載,請聯繫站長!謝謝支持!
1. 帶 [親測] 說明源碼已經被站長親測過!
2. 下載後的源碼請在24小時內刪除,僅供學慣用途!
3. 分享目的僅供大家學習和交流,請不要用於商業用途!
4. 本站資源售價只是贊助,收取費用僅維持本站的日常運營所需!
5. 本站所有資源來源於站長上傳和網路,如有侵權請郵件聯繫站長!
6. 沒帶 [親測] 代表站長時間緊促,站長會保持每天更新 [親測] 源碼 !
7. 盜版ripro用戶購買ripro美化無擔保,若設置不成功/不生效我們不支持退款!
8. 本站提供的源碼、模板、插件等等其他資源,都不包含技術服務請大家諒解!
9. 如果你也有好源碼或者教程,可以到審核區發布,分享有金幣獎勵和額外收入!
10.如果您購買了某個產品,而我們還沒來得及更新,請聯繫站長或留言催更,謝謝理解 !
GG資源網 » WordPress重定向錯誤

發表回復

CAPTCHAis initialing...