Title: Replace &#8220;index.php/&#8221; with another name
Last modified: July 13, 2018

---

# Replace “index.php/” with another name

 *  [yuanwl](https://wordpress.org/support/users/yuanwl/)
 * (@yuanwl)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/replace-index-php-with-another-name/)
 * Hi thank you for the great software! For verion 4.0, I find it useful to:
 * (1) Replace the index.php/ directory with other names (some servers confuse the
   index.php/ with index.html).
 * In the StaticHtmlOutput.php file, add
    $fileDir = str_replace(“index.php”, “wpindex_php”,
   $fileDir); somewhere before “wp_mkdir_p( $fileDir );”, then add $fileName = str_replace(“
   index.php”, “wpindex_php”, $fileName); $fileContents = str_replace(“index.php”,“
   wpindex_php”, html_entity_decode($fileContents));” before “file_put_contents(
   $fileName, $fileContents );”.
 * (2) In case the WP site is installed at a subdirectory under the “www root” directory,“
   $archiveDir” (StaticHtmlOutput.php) may be poorly defined and cause a “file not
   found” error when moving the static files. I solved it by appending the subdirectory
   name to the “$archiveDir” variable.
 * Hope it helps~

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

 *  Plugin Author [Leon Stafford](https://wordpress.org/support/users/leonstafford/)
 * (@leonstafford)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/replace-index-php-with-another-name/#post-10490270)
 * Hi Yuan,
 * Thanks very much for trying the plugin, I’m glad you had a good experience!
 * Thanks also for the index.php rewrite block.
 * Before I add it to the codebase or as an option, could you please let me know
   how you’re WordPress Permalinks are setup? I was not sure that the plugin could
   work without Permalinks set to something to avoid people seeing the index.php
   in URLs…
 * You can reply here or send me an email to [leonstafford@protonmail.com](https://wordpress.org/support/topic/replace-index-php-with-another-name/leonstafford@protonmail.com?output_format=md)
 * Cheers,
 * Leon
 *  Thread Starter [yuanwl](https://wordpress.org/support/users/yuanwl/)
 * (@yuanwl)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/replace-index-php-with-another-name/#post-10491343)
 * Hi Leon,
 *  Thanks for the reply!
 *  My perlink was set to something like “www.example.com/people/username/wpsite”.
   I chose to save the static HTMLs in a local directory (uploads/ by default) or
   download with a .zip file.

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

The topic ‘Replace “index.php/” with another name’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/static-html-output-plugin_cce3eb.
   svg)
 * [WP2Static](https://wordpress.org/plugins/static-html-output-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/static-html-output-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/static-html-output-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/static-html-output-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/static-html-output-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/static-html-output-plugin/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [yuanwl](https://wordpress.org/support/users/yuanwl/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/replace-index-php-with-another-name/#post-10491343)