Title: permalinks causing issues with php includes
Last modified: August 30, 2016

---

# permalinks causing issues with php includes

 *  [wambamboo](https://wordpress.org/support/users/wambamboo/)
 * (@wambamboo)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/permalinks-causing-issues-with-php-includes/)
 * Hello
 * I’m building my site on a subdomain.
 * I am using a php include to reference a html file which is in the root folder,
   like this:
 * `<?php include ABSPATH.'myfile.html';?>`
 * I’ve also tried this:
 * <?php include ‘myfile.html’;?>
 * If I am using default permalinks, it works great
 * If I choose any of the other permalinks settings, it only works on whichever 
   page I have set to be the static front page. All other pages just leave a space
   where the included file should be.
 * Can anyone please help me?
 * Cheers x

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Dion](https://wordpress.org/support/users/diondesigns/)
 * (@diondesigns)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/permalinks-causing-issues-with-php-includes/#post-6456008)
 * If your goal is to output a static HTML file, then try this instead:
 *     ```
       <?php readfile(ABSPATH .'myfile.html'); ?>
       ```
   
 * An error will be generated if the file doesn’t exist.
 *  Thread Starter [wambamboo](https://wordpress.org/support/users/wambamboo/)
 * (@wambamboo)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/permalinks-causing-issues-with-php-includes/#post-6456012)
 * Thanks – tried it but it made no difference. No error, still just a blank space,
   and still worked on static home page.
 *  [Dion](https://wordpress.org/support/users/diondesigns/)
 * (@diondesigns)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/permalinks-causing-issues-with-php-includes/#post-6456149)
 * Where are you adding this code? If in one of the theme files, such as page.php
   or index.php, make sure it is in every theme file that you might use for a homepage.
 * You can make sure it only displays on the front page by using the **is_front_page()**
   check.
 *  Thread Starter [wambamboo](https://wordpress.org/support/users/wambamboo/)
 * (@wambamboo)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/permalinks-causing-issues-with-php-includes/#post-6456155)
 * Hi – I’m using it in a partial template of the footer. So would expect it to 
   show up on every page. It’s setting the permalinks that breaks it, but I can’t
   work out why.
 *  Thread Starter [wambamboo](https://wordpress.org/support/users/wambamboo/)
 * (@wambamboo)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/permalinks-causing-issues-with-php-includes/#post-6456158)
 * Update – it is actually reading the html file, as I put some dummy text in there.
   Just not outputting the canvas.
 *  Thread Starter [wambamboo](https://wordpress.org/support/users/wambamboo/)
 * (@wambamboo)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/permalinks-causing-issues-with-php-includes/#post-6456218)
 * I’ve also tried it with other themes – 2013, 2014, and the problem remains the
   same.
 * BUT I tried embedding as an iframe instead and it seems to be working!
 * Is there any reason not to use an iframe?
 *  Thread Starter [wambamboo](https://wordpress.org/support/users/wambamboo/)
 * (@wambamboo)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/permalinks-causing-issues-with-php-includes/#post-6456232)
 * Solved. path to js file wasn’t right. Check your filepaths, kids!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘permalinks causing issues with php includes’ is closed to new replies.

## Tags

 * [permalinks](https://wordpress.org/support/topic-tag/permalinks/)
 * [php includes](https://wordpress.org/support/topic-tag/php-includes/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 7 replies
 * 2 participants
 * Last reply from: [wambamboo](https://wordpress.org/support/users/wambamboo/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/permalinks-causing-issues-with-php-includes/#post-6456232)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
