• Resolved marktea1

    (@marktea1)


    Hi,

    I’ve just moved a WordPress site onto a different URL into a subfolder.
    When I was changing everything over, I added the new location to the site URL etc. via the database. I then added the extra part of the URL to the index.php file (in this case it was “/wpnew”, the subdirectory the website is in), and then realised I didn’t need to add it to index.php because it then appeared twice in the URL and produced a PHP error. I removed it from index.php and resaved, then the website seemed to work again.

    However that was when I was logged in, so I tried in a different browser (which should have shown me a maintenance screen). But, when I’m not logged in, I still see the PHP error message with the /wpnew part of the URL repeated twice, when it should only be there once because I have deleted the extra /wpnew from index.php.

    Fatal error: require(): Failed opening required ‘/home/customer/www/****.com/public_html/wpnew/wpnew/wp-blog-header.php’ (include_path=’.:/usr/local/php74/pear’) in /home/customer/www/****.com/public_html/wpnew/index.php on line 17

    Can anyone tell me how I can stop this happening? It should have gone because it’s been deleted, but obviously WordPress still thinks it’s there for some reason! It only happens when I’m logged out – everything works when logged in and there’s no error message.

    Thanks for any help!

    • This topic was modified 10 months, 2 weeks ago by marktea1.
    • This topic was modified 10 months, 2 weeks ago by marktea1.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @marktea1,

    It seems like there might be some lingering settings or cached data causing this issue, specifically that the URL has the subfolder “wpnew” repeated twice.

    You may want to check your WordPress settings for permalinks. Sometimes, simply visiting the Permalinks settings page and saving changes (even without making any actual changes) can refresh the permalink structure and resolve such issues. You can also follow this article.

    I would also recommend clearing the cache from your WordPress caching plugin (if you have one installed) and any server-side caching that might be active.

    Best regards,
    Niko

    Thread Starter marktea1

    (@marktea1)

    Thanks Nico. Updating the permalinks didn’t work, but logging into the server and clearing all of the caches from there did the trick! ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP Error – subdirectory is in URL twice’ is closed to new replies.