What is the problem?
A permalink is the web address of a page, such as yourdomain.com/about. WordPress uses a file named .htaccess to handle these addresses. A folder on your hosting account might hold something that is not WordPress, such as an old app or a test page. WordPress can take over its address and show a 404 error. You can tell WordPress to leave that folder alone.
The .htaccess file is a small settings file on the Apache web server. Its name starts with a dot, so it is hidden by default.
.htaccess can cause a 500 error on your whole site. Download a copy of the file first as a backup.Steps
- Log in to your hosting control panel. Your welcome email has the details.
- Open File Manager.
- Open the folder where WordPress is installed, often
public_html. - Click Settings at the top right and tick Show Hidden Files.
- Right-click
.htaccessand choose Download to keep a copy. - Right-click it again and choose Edit.
- Find the block that starts with
# BEGIN WordPress. - Add the new line just under
RewriteBase /. - Save the file.
Here is how the block looks with the extra line. Change myfolder to your folder name.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^myfolder/ - [L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
The new rule says: if the address starts with myfolder/, stop here and do not send it to WordPress. The [L] means "last rule".
Check the result
- Open
yourdomain.com/myfolder/in your browser. - Your folder content should show.
- Check that your normal WordPress pages still work.
# BEGIN WordPress line, inside its own <IfModule mod_rewrite.c> section.Quick recap
- WordPress can hide real folders behind a 404 page.
- Add a
RewriteRuleto.htaccessfor that folder. - Always keep a copy of the file before you edit.
- Test the folder and your normal pages afterwards.