Win host WordPress pseudo static Setup method 404 Page method

Source: Internet
Author: User

    • Create a new 404.txt document and copy the following code in:
  1. Header ("http/1.1 OK");
  2. $ori _qs = $_server[' query_string ');
  3. $pattern = '/[^;] +; [^:]+://[^/]+(/[^?] *)(?:? (.*))?  /I ';
  4. Preg_match ($pattern, $ori _qs, $matches);
  5. $_server[' path_info ' = $matches [1]. ‘?’ .  $matches [2];
  6. $_server[' Request_uri '] = $_server[' path_info '];
  7. $query _args = Explode (' & ', $matches [2]);
  8. Unset ($_get);
  9. foreach ($query _args as $arg)
  10. {
  11. $the _arg = explode (' = ', $arg);
  12. $_get[$the _arg[0]] = $the _arg[1];
  13. }
  14. Include (' index.php ');
  15. ?>

After copying it, click Save As, saving to 404.php.

    • Then into the WP backstage, "settings" – "Fixed connection" inside, the first fixed connection select Custom, set to/%post_id%.html.
    • Upload the following 404.php page to the Web site root, and then in the virtual host Control Panel to modify the 404 jump page for just uploaded 404.php, so you can implement pseudo-static
address of this article:Https://www.lisen.me/251.html
Copyright Notice:This article for the original article, copyright belongs to Leeson Blog all, welcome to share this article, reproduced please keep the source!

Win host WordPress pseudo static Setup method 404 Page method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.