Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to make WordPress ignore a folder or file path

Sometimes you keep a folder inside your site that WordPress should not touch. This guide shows how to stop WordPress from taking over that path.

WordPress2 min read9 steps

What is the problem?

WordPress uses "pretty permalinks". These are clean page addresses such as /about-us. To make them work, WordPress catches every address that is not a real file or folder. If you have your own folder, like /shop-app, WordPress may show a 404 error instead of your folder.

The rules live in a file called .htaccess. It is a small settings file that the Apache web server reads. Most hosting plans use Apache or something that works like it. Ask Hostvento support if you are not sure about yours.

Warning: A mistake in .htaccess can take your site down. Download a copy of the file as a backup before you edit it.

Steps

  1. Log in to your hosting control panel and open File Manager.
  2. Go to the folder where WordPress is installed, often public_html.
  3. Turn on Show Hidden Files, since .htaccess starts with a dot.
  4. Right-click .htaccess, and choose Download to keep a backup.
  5. Right-click it again and choose Edit.
  6. Find the block that begins with # BEGIN WordPress.
  7. Add a new line just above that block, as shown below.
  8. Save the file.
  9. Open the folder address in your browser to test it.
RewriteEngine On
RewriteRule ^shop-app/ - [L]

# BEGIN WordPress
...

This rule says: if the address starts with shop-app/, stop and do nothing else. The [L] means "last rule". WordPress will then leave that folder alone. Replace shop-app with your own folder name.

Ignore more than one path

Use a bar character between the names:

RewriteRule ^(shop-app|files|tools)/ - [L]

This ignores three folders in one line.

Why put it above WordPress?

The server reads rules from top to bottom. Your rule must come first so it works before WordPress takes over. WordPress may rewrite its own block, so never put your lines inside the # BEGIN WordPress and # END WordPress markers.

Tip: Make sure the folder really exists and has an index.html or index.php file inside.

If the folder still shows a 404, open a support ticket.

Quick recap

  • WordPress can hide real folders behind its pretty addresses.
  • Add a RewriteRule with [L] to .htaccess.
  • Place it above the # BEGIN WordPress block.
  • Download a backup of the file before you edit it.