403 is an access denied error. Usually ownership or permissions related.
General Reference: http://en.wikipedia.org/wiki/HTTP_403
I’ve been trying to figure out how to get “pretty links” to work on my local development machine.
You didn’t mention mod_rewrite, so I will… It’s installed and functioning? Some reference material: Using Permalinks
I do have mod_rewrite un-commented through the httpd.conf file ( see below ):
[ Excrept ]:
#LoadModule reflector_module modules/mod_reflector.so
#LoadModule remoteip_module modules/mod_remoteip.so
#LoadModule request_module modules/mod_request.so
#LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule sed_module modules/mod_sed.so
#LoadModule session_module modules/mod_session.so
#LoadModule session_cookie_module modules/mod_session_cookie.so
I’ve looked into the access logs for any clues and found this particular message for every 403 error encountered:
[Tue Feb 11 10:42:45.823002 2014]
[rewrite:error]
[pid 3184:tid 916]
[client 127.0.0.1:61127] AH00670:
Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so the RewriteRule directive is also forbidden due to its similar ability to circumvent directory restrictions :
C:/rel/httpd/docs/wordpress.test/index.php
Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so the RewriteRule directive is also forbidden
That might be telling you where you could start troubleshooting.
You can try placing this at the very top of your .htaccess file and see if it helps. Or if it at least changes the error message.
Options +FollowSymlinks
There might also be more info that could help if you go back and take a look at Using “Pretty” permalinks
Changing the httpd-vhosts.conf file to below:
<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@wordpress.test
DocumentRoot "C:/rel/httpd/docs/wordpress.test"
ServerName wordpress.test
ServerAlias www.wordpress.test
ErrorLog "logs/wordpress.test-error.log"
CustomLog "logs/wordpress.test-access.log" common
<Directory "C:/rel/httpd/docs/wordpress.test">
AllowOverride All
Require all granted
</Directory>
<IfModule dir_module>
DirectoryIndex index.php
</IfModule>
</VirtualHost>
…and the .htaccess file to below:
Options +FollowSymLinks
# 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
This still results in an error 403.
I don’t think it would be an issue with permissions, since Apache is running as a service in Windows through a local system account.
What is interesting is three successive 403’s that are very close in time to eachother:
[Wed Feb 12 22:38:08.146163 2014] [rewrite:error] [pid 2832:tid 932] [client 127.0.0.1:51332] AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so the RewriteRule directive is also forbidden due to its similar ability to circumvent directory restrictions : C:/rel/httpd/docs/wordpress.test/index.php
[Wed Feb 12 22:38:08.310224 2014] [rewrite:error] [pid 2832:tid 932] [client 127.0.0.1:51332] AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so the RewriteRule directive is also forbidden due to its similar ability to circumvent directory restrictions : C:/rel/httpd/docs/wordpress.test/index.php
[Wed Feb 12 22:38:08.334784 2014] [rewrite:error] [pid 2832:tid 932] [client 127.0.0.1:51332] AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so the RewriteRule directive is also forbidden due to its similar ability to circumvent directory restrictions : C:/rel/httpd/docs/wordpress.test/index.php
Ok, I found the solution.
Recall that:
I am using Apache 2.4.7 (x64) with PHP configured through mod_fastcgi 2.3.9 (also x64); all built for Windows machines.
The key phrase here was “with PHP configured through mod_fastcgi 2.3.9”.
The original configuration on how the web server handled .php files is below:
#
# Loads the parameters for the Fast CGI Module
# This module interfaces with PHP
#
<IfModule fcgid_module>
FcgidInitialEnv PATH "C:/rel/php;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"
FcgidInitialEnv windir "C:/WINDOWS"
FcgidIOTimeout 360
FcgidIdleTimeout 600
FcgidConnectTimeout 16
FcgidMaxRequestsPerProcess 1000
FcgidMaxProcesses 50
FcgidMaxRequestLen 8131072
# Location php.ini:
FcgidInitialEnv PHPRC "C:/rel/php"
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
</IfModule>
#
# Ensures that only files ending in the .php extension are processed
#
<Files ~ "\.php$>"
AddHandler fcgid-script .php
FcgidWrapper "C:/rel/php/php-cgi.exe" .php
Options ExecCGI
Require all granted
</Files>
Note that the files directive for Apache applies configuration options only to specific files matching whatever is specified above; in this case, PHP files. Also, note the absence of FollowSymLinksin the Optionsdirective…
Once FollowSymLinkswas added, everything just worked!
Now, make sure that you do allow Apache to access and tell Apache to read the .htaccess file in WordPress’ root directory, or else any changes WordPress makes to that file will be ignored.