Support » Fixing WordPress » 404 Not Found when linking from Facebook and LinkedIn

  • Resolved doolwind


    My website has been running fine for years. About 4 weeks ago I started having problems:

    1. When I try and link to my blog from Facebook or LinkedIn I get “404 Not Found” errors
    2. Google has stopped linking to my website (and it doesn’t show up in search results)

    What’s strange is that is working fine if I (or anyone I know) navigates to it. It just seems that Google, Facebook and LinkedIn are having issues seeing it.

    If I link to a regular .php page on my site then the links from Facebook etc, work (eg. my login page).

    One thing worth noting is that I have a redirect set up from to using the following php:
    header( 'Location:' );

    I have tried the following solutions after searching the WordPress forums:

    1. Changing permalinks back to default (including setting .htaccess to 666 while changing)
    2. Deactivating all plugins. Problem still exists
    3. Linking to the root of my blog ( to posts and to pages, all without success
    4. Disabling the index.php redirect (described above). Problem still exists

    I contacted Dreamhost and they say nothing has changed with my server in the past few months.

    I’ve checked the other sites I run with Dreamhost and they are not having this problem. Any help would be greatly appreciated.


Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator James Huff


    Are your blog files currently in the /blog/ directory?

    Yes is the root of my install, and the site_url and home are both set correctly to this address.

    Moderator James Huff


    In that case, get rid of whatever you have the header redirect in (I’m assuming probably an index.php file in the root) and replace it with an index.html file with only the following content:

    <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""><html xmlns=""><head><title></title><meta http-equiv="refresh" content="0;url= blog/" /></head><body></body></html>

    Thanks macmanx. I tried that however my links from Facebook still don’t work. What I can do however is link directly to the index.html file and it works.

    It seems whenever I link to a file it works however if I link to anything else (eg /blog/, /blog/post-name, etc) it doesn’t work. This leads me to think it’s some kind of url redirect issue but I’ve tried fixes in this area without success.

    Moderator James Huff


    That’s really weird. Try deactivating all of your plugins. If that resolves the issue, reactivate each one individually until you find the cause.

    Moderator James Huff


    Ok, I see what’s going on now. When I try to share this on Facebook:

    I get this:

    The requested URL /dors/doolwind/646f6f6c77696e642e636f6d626c6f676e61727261746976652d64656174682d76732d67616d652d6d656368616e69632d6465617468.html was not found on this server.

    If deactivating your plugins doesn’t solve the problem, can you post the contents of your .htaccess file?

    I’ve tried deactivating all my plugins with no success.

    Below are the contents of my .htaccess files
    In the root of

    #--- DH-PHP handlers ---
    AddHandler php-cgi .php
    Action php-cgi /cgi-bin/dispatch.cgi
    #AddHandler fastcgi-script fcg fcgi fpl
    #AddHandler php-fastcgi .php
    #Action php-fastcgi /cgi-bin/dispatch.fcgi

    In the root of the blog:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    # END WordPress

    Anymore you want to see? I’m in the middle of recreating my blog in a different directory and I’m going to try replacing the old with the new to see if that solves the problem. If I could fix the existing one I’d much prefer that though 🙂

    Moderator James Huff


    Everything looks right. The only think left that I can suggest would be to deactivate your plugins, then re-save your permalink structure, then reactivate your plugins.

    I have resolved the problem by creating a new install of WordPress, exporting and reimporting my data and copying my entire plugins directory. I’m unsure what the original cause of the problem is but somehow the reinstall has fixed the issue.

    Thanks for your help macmanx.

    Moderator James Huff


    You’re welcome!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘404 Not Found when linking from Facebook and LinkedIn’ is closed to new replies.