---
title: "Set WordPress to ignore a File Path"
description: "Sometimes, you need to allow access to a file or directory but don't need a subdomain. For example, you may upload a file or folder to your public_html directory, but WordPress may show a 404 error..."
url: https://www.inmotionhosting.com/support/edu/wordpress/set-wordpress-to-ignore-a-file-path/
date: 2018-09-25
modified: 2022-03-04
author: "InMotion Hosting Contributor"
categories: ["WordPress Hosting", "WordPress Tutorials"]
type: post
lang: en
---

# Set WordPress to ignore a File Path

![Set WordPress to Ignore a File Path](https://www.inmotionhosting.com/support/wp-content/uploads/2018/09/wordpress-ignore-file-path-1024x538.jpg)

Sometimes, you need to **allow access to a file or directory but don't need a subdomain**. For example, you may upload a file or folder to your *public_html* directory, but WordPress may show a 404 error when attempting to access its file path. In such situations, you can create a **rewrite condition** within your .htaccess file to force your WordPress website to ignore the file path of that file. This would allow a file - e.g. *domain.com/file.html* - to display as is instead of embedded as part of the parent WordPress website.

## Edit WordPress to Ignore a File Path

1. Log into [SSH](/support/server/ssh/do-you-provide-ssh-access/) or [cPanel File Editor](/support/website/how-to-edit-a-file/).
2. Navigate to your WordPress root directory.
3. Open your website [.htaccess file](/support/website/where-is-my-htaccess-file/).
4. Below is the default [WordPress .htaccess file](https://codex.wordpress.org/htaccess): # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php </IfModule> # END WordPress Add the following above the *RewriteCond* lines, replacing *file* with the file path to your saved files: RewriteCond $1 !^(/file)
5. Save your changes.

You should now be able to visit the URL for that HTML file without your WordPress website attempting to integrate it as part of the website.
