• I am developing a WordPress site that also includes external non-Wordpress pages. As a test I created a WordPress page with a path of “example.com/path-to-a/index.php” which displays properly. I next created an external non-Wordpress page with a path of “example.com/path-to-a/path-to-b/index.php” which also displays properly. However, the WordPress page at “path-to-a/index.php” no longer displays but returns a Forbidden message. What is the solution to fix this problem?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    I don’t understand how you can have a WP page with a permalink like example.com/path-to-a/index.php. I mean WP pages that are of the ‘page’ post type and are stored in the DB. If you were to create a page titled path-to-a/index.php, WP will create a permalink of example.com/path-to-a-index-php/ as any special chars besides - are not allowed as slug elements.

    When you created the path-to-a/path-to-b/index.php file, you created an actual directory on your server below the WP installation. Any request that involves an actual directory or file in or below the installation directory will not involve WP at all, so there is no way to display any WP content when actual files and directories exist.

    In furthering this discussion, it’s useful to know in what directory WP is installed. Public root or /path-to-a/?

    Thread Starter tboeker

    (@tboeker)

    Thanks for the information. WP is installed in the public root.

    As a possible workaround is it possible to make a php call to WP to invoke a page from its database? The idea is place an external page at path-to-a/ that would contain and execute code that would in turn display the WP page at that permalink.

    Thanks

    Moderator bcworkz

    (@bcworkz)

    WP content can only be implemented through HTTP[S] requests. You could have a PHP page at path-to-a that sends out a location header, redirecting to the desired WP page. Or you could have the path-to-a page include the WP page in an iframe.

    You could also get page content through a REST API request, but it will be the content in JSON format, without any CSS, header, footer, etc.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Integrating external pages into WordPress site’ is closed to new replies.