How to resolve 403 errors after setting pretty permalinks
-
I have installed some WordPress sites on my Ubuntu machine at home and in one site have run into a problem with 403 errors on all permalink settings except plain. It is hard to determine whether the issue is caused by Apache’s redirection config or permissions set on WordPress files. The error is:
Forbidden
You don’t have permission to access this resource.
Apache/2.4.46 (Ubuntu) Server at https://www.thelearningcentres.net Port 443I am tempted to believe that the matter pertains to redirection because I’m assuming that if a page doesn’t display because of file permissions it should not matter if the file is referred to, as for example, page_id=12 or courses.
thelearningcentres.com.conf contains:
<Directory "/path to/public_html"> Options -FollowSymLinks +SymLinksIfOwnerMatch AllowOverride All allow from all Options None Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined RewriteEngine on RewriteCond %{SERVER_NAME} =www.thelearningcentres.net [OR] RewriteCond %{SERVER_NAME} =thelearningcentres.net RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
The SSL conf thelearningcentres.net-le-ssl.conf contains:
<Directory "/path to/public_html"> Options -FollowSymLinks +SymLinksIfOwnerMatch AllowOverride All allow from all Options None Require all granted </Directory>
I assume that the duplication in the <Directory> block is not the issue because other sites on the sever have the exact same style and work as expected.
I have set folder permissions to 755 and files to 644 but as noted, if file permissions was the issue it shouldn’t matter the file name.
This matter seems to keep recurring as a Web search turns up scores of questions on different fora and for every one solved by resetting file permissions, there are 20 with no resolution posted. The Common WordPress Errors page does not even mention it, the closest being the 404 file not found error when images are uploaded following setting pretty permalinks.
I’d really love any help with this and maybe a keen eye will see a conflict in the conf files.
- The topic ‘How to resolve 403 errors after setting pretty permalinks’ is closed to new replies.