0
votes

I have a wordpress site and I also have pages/files/folders that I've created outsite of wordpress. Right now, I have no permalinks with my URLs as site.com?p=123. I want to have permalinks (pretty links) as site.com/postname (I know the permalink string is /%postname%/). I also have pages that are on my site that have nothing to do with the wordpress site.

When I changed the permalinks in wordpress, all my posts work fine just like they should. But when I try going to an outsite wordpress page/folder like site.com/file_name.php or site.com/folder_name/ I get HTTP 404 not found.

Is there a way that I can do this, or am I stuck with having just the post id permalink?

2

2 Answers

0
votes

Open up the Wordpress .htaccess file after enabling SEO permalinks and add the following line on top:

ErrorDocument 401 default

Let me know if that works, or you can always explicitly allow those specific files/folders in the .htaccess file.

0
votes

The default WordPress .htaccess configuration for permalinks should handle files that exist on the file system outside of WordPress. You can read about using permalinks in the Using Permalinks documentation on WordPress.

Of note is the snippet that you're supposed to include in .htaccess (so maybe update your .htaccess file to contain this content):

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

The RewriteCond clauses tell WordPress that if the current URL either points directly to a file or to a directory, then WordPress will ignore it and let the file load normally.