Home » Php » My rewrite rules automatically changing and showing 404 error again and again?

My rewrite rules automatically changing and showing 404 error again and again?

Posted by: admin October 26, 2017 Leave a comment

Questions:

My website showing 404 page not found again and again. After permalink changes, it’s working well for sometime then again showing same error.

Steps I tried:

  1. permalink changed
  2. .htaccess edit
  3. clear caches
  4. made .htaccess file as read only.

and after debug I found this

My rewrite rules automatically changing :

(.?.+?)(?:/([0-9]+))?/?$ index.php?pagename=$matches[1]&page=$matches[2]

to Rule:

([^/]+)(?:/([0-9]+))?/?$ index.php?name=$matches[1]&page=$matches[2]

MATCH RULE OF WORKING CODE

Matched Rule: (.?.+?)(?:/([0-9]+))?/?$ Matched Query: pagename=aboutus&page= Query String: pagename=aboutus&debug-this=rewrites

MATCH RULE OF ERROR(AUTOMATICALLY CHANGING) CODE

Matched Rule: ([^/]+)(?:/([0-9]+))?/?$ Matched Query: name=aboutus&page= Query String: name=aboutus&debug-this=rewrites
([^/]+)(?:/([0-9]+))?/?$ index.php?name=$matches[1]&page=$matches[2]

Answers:

Check over your plugins that you have active. It’s possible you have something in there that’s making the change.

Also be sure that your host isn’t messing with things behind the scenes.