admin管理员组

文章数量:1130349

I moved WordPress out of the root of my server into a special folder of its own and now Google is indexing my posts together with that special WordPress folder thus creating some 404 error issues.

For example let's say my WordPress core files are installed in / but the home page is /.

This post link / works fine and has been indexed by Google. Unfortunately, Google is also indexing ://www.example/hello-world/435/ thus creating 404 errors in Google Search console.

So my question is, is there a way to use .htaccess to make links like ://www.example/hello-world/435/ to redirect to the right link which is /?

I moved WordPress out of the root of my server into a special folder of its own and now Google is indexing my posts together with that special WordPress folder thus creating some 404 error issues.

For example let's say my WordPress core files are installed in https://www.example/wordpress/ but the home page is https://www.example/.

This post link https://www.example/hello-world/435/ works fine and has been indexed by Google. Unfortunately, Google is also indexing https://www.example/wordpresshttps://www.example/hello-world/435/ thus creating 404 errors in Google Search console.

So my question is, is there a way to use .htaccess to make links like https://www.example/wordpresshttps://www.example/hello-world/435/ to redirect to the right link which is https://www.example/hello-world/435/?

Share Improve this question edited Jan 10, 2019 at 0:37 MrWhite 3,8911 gold badge20 silver badges23 bronze badges asked Jan 9, 2019 at 13:53 UdegbunamChuksUdegbunamChuks 113 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 0

I've fixed it using the rule below

RewriteRule ^(.*)wordpresshttps:/www.example/(.*)$ https://www.example/$2 [L,R=301]

I moved WordPress out of the root of my server into a special folder of its own and now Google is indexing my posts together with that special WordPress folder thus creating some 404 error issues.

For example let's say my WordPress core files are installed in / but the home page is /.

This post link / works fine and has been indexed by Google. Unfortunately, Google is also indexing ://www.example/hello-world/435/ thus creating 404 errors in Google Search console.

So my question is, is there a way to use .htaccess to make links like ://www.example/hello-world/435/ to redirect to the right link which is /?

I moved WordPress out of the root of my server into a special folder of its own and now Google is indexing my posts together with that special WordPress folder thus creating some 404 error issues.

For example let's say my WordPress core files are installed in https://www.example/wordpress/ but the home page is https://www.example/.

This post link https://www.example/hello-world/435/ works fine and has been indexed by Google. Unfortunately, Google is also indexing https://www.example/wordpresshttps://www.example/hello-world/435/ thus creating 404 errors in Google Search console.

So my question is, is there a way to use .htaccess to make links like https://www.example/wordpresshttps://www.example/hello-world/435/ to redirect to the right link which is https://www.example/hello-world/435/?

Share Improve this question edited Jan 10, 2019 at 0:37 MrWhite 3,8911 gold badge20 silver badges23 bronze badges asked Jan 9, 2019 at 13:53 UdegbunamChuksUdegbunamChuks 113 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 0

I've fixed it using the rule below

RewriteRule ^(.*)wordpresshttps:/www.example/(.*)$ https://www.example/$2 [L,R=301]

本文标签: redirectHow To Fix 404 errors caused by Google Indexing Wordpress In Subdirectory