Knowledge Base
MilesWeb / WordPress FAQ

Steps to Set WordPress to Ignore a File Path

Approx. read time : 2 min

Sometimes, it is important to allow access to a file or directory but don’t require a sub domain. For example, when you upload a file or folder to your public_html directory, but WordPress shows a 404 error while attempting to access its file path. In such cases, you can create a rewrite condition within your .htaccess file to force your WordPress website to ignore the file path of that file. With this a file – e.g. – will get displayed as is instead of embedded as part of the parent WordPress website.

Steps to Edit WordPress to Ignore a File Path

  1. Login to your account via SSH or cPanel File Editor, navigate to your WordPress directory.
  2. Open your website with .htaccess file.
  3. Check below the default WordPress .htaccess file:

    Add the below code above the RewriteCond lines, replacing file with the file path to your saved files:
  4. Then save your changes.
Pallavi Godse
Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.