Title: .htaccess rules
Last modified: February 1, 2021

---

# .htaccess rules

 *  Resolved [semplicewebsite](https://wordpress.org/support/users/semplicewebsite/)
 * (@semplicewebsite)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/htaccess-rules/)
 * Hello, I had a problem in a particular case. I have installed a website not in
   the main root but in a subfolder, also for security reasons, so I copy the .htaccess
   and index.php files to the root. The problem is that the plugin writes the rewrite
   rule to the root .htaccess file instead of the wordpress installation folder.
   In this way it is sufficient that anyone has the link to the user’s file to be
   able to open it. I solved it like this: I copied the string to the root .htaccess
   file and deleted it. I pasted it into the .htaccess file of the installation 
   folder but I deleted the path to the installation folder. I’ll give you an example.
 *     ```
       # BEGIN User Private Files
       # Le direttive (linee) tra <code>BEGIN User Private Files</code> e <code>END User Private Files</code> sono
       # generate dinamicamente, e dovrebbero essere modificate solo tramite i filtri di WordPress.
       # Ogni modifica alle direttive tra questi marcatori verrà sovrascritta.
       RewriteRule ^wp-content/uploads/upf-docs/(.*)$ https://mywebsite.it/folder-wordpress-setup?file=$1 [QSA,L]
       # END User Private Files
       ```
   
 * This is the code with the path of the installation folder which, however, also
   prohibits access to the owner user
 *     ```
       # BEGIN User Private Files
       # Le direttive (linee) tra <code>BEGIN User Private Files</code> e <code>END User Private Files</code> sono
       # generate dinamicamente, e dovrebbero essere modificate solo tramite i filtri di WordPress.
       # Ogni modifica alle direttive tra questi marcatori verrà sovrascritta.
       RewriteRule ^wp-content/uploads/upf-docs/(.*)$ https://mywebsite.it/?file=$1 [QSA,L]
       # END User Private Files
       ```
   
 * The latter instead is the pathless code of the wordpress installation folder 
   that works. Do you by any chance have a better idea for this particular case?
   I’m not actually the only one as it is a common measure to increase security.

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

 *  Plugin Author [Deepak Khokhar](https://wordpress.org/support/users/deepakkite/)
 * (@deepakkite)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/htaccess-rules/#post-13990411)
 * Hi [@semplicewebsite](https://wordpress.org/support/users/semplicewebsite/)
 * Thanks for reporting the issue. I have updated the plugin to use correct htaccess
   path and site url to redirect file requests to.
 * Please update to the latest 1.0.3 version and the issue should be fixed.
 * Thanks
 *  Thread Starter [semplicewebsite](https://wordpress.org/support/users/semplicewebsite/)
 * (@semplicewebsite)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/htaccess-rules/#post-13990664)
 * Great !! Now it works great !!
 * Thanks so much again!
    If there are other critical issues I will report them 
   to you. it’s nice to be able to collaborate
 *  Plugin Author [Deepak Khokhar](https://wordpress.org/support/users/deepakkite/)
 * (@deepakkite)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/htaccess-rules/#post-13993234)
 * [@semplicewebsite](https://wordpress.org/support/users/semplicewebsite/) Thanks
   for your help on identifying the issues. Appreciate it 🙂

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

The topic ‘.htaccess rules’ is closed to new replies.

 * ![](https://ps.w.org/user-private-files/assets/icon-256x256.png?rev=2464671)
 * [File Sharing & Download Manager - User Private Files](https://wordpress.org/plugins/user-private-files/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-private-files/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-private-files/)
 * [Active Topics](https://wordpress.org/support/plugin/user-private-files/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-private-files/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-private-files/reviews/)

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [Deepak Khokhar](https://wordpress.org/support/users/deepakkite/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/htaccess-rules/#post-13993234)
 * Status: resolved