One set of Child Pages redirecting to Home page?

I've searched multiple forums, and not finding anything quite like this... On a site I manage, there are several parent pages with links to child pages embedded in images. Each image links to the corresponding child page without a problem. ONE of the parents pages, however, when I click on any of the images (or even try to manually direct to one of the child pages), it redirects to the homepage. I've read through the code several times and can't find the problem. I know it's not a problem with any of the shortcode, because all the other parent pages using the same shortcode are working perfectly. Anyone have any suggestions on where to look to possibly track down this problem?

Topic child-pages redirect homepage Wordpress

Category Web


If you want to do this in your .htaccess file to ensure an early redirect, the method is as follows.

First check if the page does not exist using the rewrite condition:

RewriteCond %{REQUEST_FILENAME} !-f

Next comes the rewrite rule for the page that does not exist

RewriteRule ^/au/location1/(.*)$ http://example.com/au/location1/ [L]

Putting this all together:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f  
RewriteRule ^/au/location1/(.*)$ http://example.com/au/location1/ [L]

Now if the page example.com/au/location1/staff exists then there will be no redirect, however if the page example.com/au/location1/staff does not exist the the user will be redirected to example.com/au/location1/.

Notice that this will apply to all child pages off example.com/au/location1/ i.e. any child pages that do not exist will redirect to the parent page.

I hope that I have interpreted your question correctly and that this helps.


Sounds like your permalinks could possibly be jumbled. Have you tried resaving your permalinks and seeing if the problem persists?

Settings > Permalinks and just click "Save Changes."

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.