Title: Restrict PHP whitelist
Last modified: July 15, 2020

---

# Restrict PHP whitelist

 *  Resolved [Jason Chong](https://wordpress.org/support/users/dantianhealth/)
 * (@dantianhealth)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/restrict-php-whitelist/)
 * I am wanting to enable the discuz ajax function for article rating.
    It does 
   not function due to a rule in .htaccess as below
 * # Restrict Access to Theme and Plugins PHP Files
    RewriteRule wp-content/plugins/(.*\.
   php)$ – [R=404,L]
 * I have attempted to whitelist the wpdiscuz by
 * RewriteCond %{REQUEST_URI} !^/wp-content/plugins/wpdiscuz/utils/ajax/wpdiscuz-
   ajax\.php
    RewriteCond %{REQUEST_URI} !^/wp-content/plugins/wpdiscuz/utils/ajax/
   RewriteRule wp-content/plugins/(.*\.php)$ – [R=404,L]
 * This is not working and I suspect I am missing something.
    When I try to save
   a rating it looks like ajax but it does not save the rating. Is there another
   php file that needs whitelisting to allow this to function?

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

 *  Plugin Support [gVectors Support](https://wordpress.org/support/users/gvectorssupportmember/)
 * (@gvectorssupportmember)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/restrict-php-whitelist/#post-13134673)
 * Hi [@dantianhealth](https://wordpress.org/support/users/dantianhealth/),
 * Please leave the example URL.
 *  Thread Starter [Jason Chong](https://wordpress.org/support/users/dantianhealth/)
 * (@dantianhealth)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/restrict-php-whitelist/#post-13135633)
 * Hi
    I found an issue with my whitelist code. I utilised this and it seems to 
   work
 * RewriteCond %{REQUEST_URI} !/wp-content/plugins/wpdiscuz/utils/ajax/wpdiscuz-
   ajax.php
    RewriteRule wp-content/plugins/(.*\.php)$ – [R=404,L]
 * Hopefully someone else finds that useful if working to secure their site

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

The topic ‘Restrict PHP whitelist’ is closed to new replies.

 * ![](https://ps.w.org/wpdiscuz/assets/icon-256x256.png?rev=1076265)
 * [Comments - wpDiscuz](https://wordpress.org/plugins/wpdiscuz/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpdiscuz/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpdiscuz/)
 * [Active Topics](https://wordpress.org/support/plugin/wpdiscuz/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpdiscuz/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpdiscuz/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Jason Chong](https://wordpress.org/support/users/dantianhealth/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/restrict-php-whitelist/#post-13135633)
 * Status: resolved