How to Stop WordPress From Passing to index.php

If you're integrating a WordPress blog into an existing website, you might experience a problem when attempting to visit the existing website's home page. WordPress uses a URL rewrite code to pass all home page requests in the blog directory to the "index.php" page. This is done to prevent search engines listing your home page multiple times, which can interfere with search engine optimization. Fortunately, you can stop this automatic URL redirection by adding a line of code to your WordPress theme's "functions.php" file.

Instructions

    • 1

      Log in to your WordPress dashboard by typing your domain name followed by "/wp-content/" in the address bar and pressing "Enter."

    • 2

      Type your username and password in the provided text fields, then click "Log in."

    • 3

      Click the "Editor" link in the "Appearance" menu on the right side of the WordPress dashboard.

    • 4

      Click the "Theme Functions (functions.php)" link in the menu on the right to open the page for editing.

    • 5

      Scroll to the bottom of the "functions.php" page and click to place your cursor at the end of the last line. Press "Enter" to create a new line.

    • 6

      Type "remove_filter('template_redirect', 'redirect_canonical');" and press "Enter."

    • 7

      Click the "Update File" button at the bottom of the page.

Related Searches:

References

Comments

Related Ads

Featured