Drupal throws 404 error after sharing a link on Facebook [Solved]

I had a strange error today. Lukily, a friend of mine warned me about it. I could hardly be aware of it without his help. (Thanks, Iosif!) So…

Why does Drupal 7 throws 404 error (Page not found)?

[adsense:336×280:6928840684]

There could be plenty of reasons, but I guess the reason here is a bit stranger. All urls looked absolutely normal to me. I am using Pathauto with clean urls on. So why only SOME users get the page not found error? While looking at access logs, it seemed absolutely random to me. Of course, I had no 301 or 302 redirection component in case of errors.

I also didn’t display a nice and friendly page for 404 errors (I thought I hadn’t any). Pretty ignorant, huh? Visitors were discouraged and left away without even bothering to use the search box.

After a little bit of reasearch, I found a topic on a forum (I can’t remember it, sorry) that gave me a hint. 

I had a multilanguage module installed I almost have forgotten of. In the module’s settings page (admin/config/regional/language/configure) there were two checkboxes checked: User (Follow the user’s language preference) and Browser (Determine the language from the browser’s language settings).

With these settings on, the browsers who had a different default language other than English could have been redirected to a non existing page. That’s because the website’s interface is now in English only.

How to fix Drupal 7 Page not found error?

[adsense:336×280:5172905888]

  • Disable multilanguage support if not needed.
  • Uncheck ALL support for automatic language detection in admin/config/regional/language/configure.
  • Change all content’s default language to Language neutral (If you choose this you won’t be able to edit your content later) English (or your default website language). If you have lots of content use VBO + Administration Views.
  • Lastly, monitor your 404 error pages and redirect them with Redirect module or other redirection module.

If I helped you with this article, leave some feedback please. I really enjoy reading comments!

LĂSAȚI UN MESAJ

Vă rugăm să introduceți comentariul dvs.!
Introduceți aici numele dvs.
Captcha verification failed!
Scorul utilizatorului captcha a eșuat. va rog sa ne contactati!

Acest site folosește Akismet pentru a reduce spamul. Află cum sunt procesate datele comentariilor tale.

- Advertisement -spot_img
Noutăți

Articole similare

- Advertisement -spot_img