Title: Don&#8217;t use .php files
Last modified: March 5, 2018

---

# Don’t use .php files

 *  [cristianuibar](https://wordpress.org/support/users/cristianuibar/)
 * (@cristianuibar)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/dont-use-php-files/)
 * Is there a way to not minify / optimize using PHP files?
 * Our host in blocking non-wordpress default external PHP files for security purposes.
   Here is a URL from the dev site: [https://stage.hermandadblanca.org/s/f.php?e5dfbb.js](https://stage.hermandadblanca.org/s/f.php?e5dfbb.js)
 * Can we disable this functionality or as an alternative can’t we load these from
   a URL? Like: /s/f/?something.js which can be redirected by the add_rewrite_rule
   functionality? [https://developer.wordpress.org/reference/functions/add_rewrite_rule/](https://developer.wordpress.org/reference/functions/add_rewrite_rule/)
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdont-use-php-files%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Denis Ryabov](https://wordpress.org/support/users/dryabov/)
 * (@dryabov)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/dont-use-php-files/#post-10041196)
 * There are three different ways to distribute optimized css and js files (see “
   Distribute method” in the Advanced tab):
 * 1. Direct. In this case your webserver is responsive for compression and sending
   expiration headers.
    2. Apache (there are two alternatives depending on installed
   Apache modules: mod_rewrite+mod_headers and mod_rewrite). Sending of precompressed
   files with expiration headers is made using special .htaccess file. 3. PHP. Sending
   of precompressed files with expiration headers is made by PHP.
 * You can use way #1 if others are not suitable.
 *  Thread Starter [cristianuibar](https://wordpress.org/support/users/cristianuibar/)
 * (@cristianuibar)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/dont-use-php-files/#post-10043772)
 * Thank you. I have found that option right after writing this support message.
 * Still, I am facing another issue: If I’m using the first option for the parser,
   Standard HTML parser it does not parse anything,- or not always I can’t tell.
   Sometimes it does minify the HTML sometimes it doesn’t; it depends on the options
   I chose. But the JS/CSS merging doesn’t work at all only in Fast Simple HTML 
   parser.
 * Anyway, using Fast simple HTML parser works perfectly. With a single exception,
   the merged files for JS/CSS are 404-ing. And I can’t seem to find where these
   files are generated on disk for me to create a nginx redirect to them.
 * Where are the merge files saved? Can you guys save them in a folder inside the
   uploads folder and link them from there?
 *  Thread Starter [cristianuibar](https://wordpress.org/support/users/cristianuibar/)
 * (@cristianuibar)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/dont-use-php-files/#post-10043795)
 * I am talking after the static files, which are linked to the location specified
   in the field which defaults to /s I guess.
    Here is an example: [https://cdn.stage.hermandadblanca.org/s/d7baf4.js](https://cdn.stage.hermandadblanca.org/s/d7baf4.js)
 * NOTE: My hosting is automatically rewriting all my URLs for static files to CDN.
   Still, I can’t find the actual files on disk.
 * My hosting has the “root” folder inside wp-content/root/ which is sym-linked 
   inside the docker container to the actual site root and all WP default files 
   and folders like wp-admin and wp-includes are read-only. Maybe this will help
   you guys debug the issue further and make it compatible with all hosting environments
   especially the modern use of distributed systems like kubernetes and docker.
 * BTW: We are going to use this plugin on multiple high-traffic sites with millions
   of page views monthly so we need it to perform very well and thus far it’s working
   wonderful in our tests. Keep up the good work guys! You did it very well and 
   easy to use.

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

The topic ‘Don’t use .php files’ is closed to new replies.

 * ![](https://ps.w.org/psn-pagespeed-ninja/assets/icon.svg?rev=1722219)
 * [PageSpeed Ninja - Cache, Minify, Defer CSS JavaScript, Critical CSS, Optimize Images, Convert WebP](https://wordpress.org/plugins/psn-pagespeed-ninja/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/psn-pagespeed-ninja/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/psn-pagespeed-ninja/)
 * [Active Topics](https://wordpress.org/support/plugin/psn-pagespeed-ninja/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/psn-pagespeed-ninja/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/psn-pagespeed-ninja/reviews/)

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [cristianuibar](https://wordpress.org/support/users/cristianuibar/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/dont-use-php-files/#post-10043795)
 * Status: not resolved