Search code examples
macoswordpresspermalinks

Wordpress - Localhost Mac Permalinks 404


I have followed several documents and other helpful tips on here and no luck getting my Permalinks to work locally! I need to get it working in order to access the /shop/ link that uses WooCommerce and do some debugging, modifications. Without access, I can't get to the files and work on them locally. I've set my httpd.conf file and myname.conf file to AllowOverride All, added the below info to .htaccess (which I believe is writable). Only default settings for links work.

httpd.conf settings:

<Directory "/Users/myname/Sites">
Options Indexes MultiViews FollowSymLinks
AllowOverride All AuthConfig
Order allow,deny
Allow from all
</Directory>

myname.conf settings:

<Directory "/Users/myname/Sites/">
 Options Indexes MultiViews FollowSymLinks
 AllowOverride All AuthConfig
 Order allow,deny
 Allow from all
</Directory>

.htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.so>
ErrorDocument 404 /site/index.php?error=404
RewriteEngine On
RewriteBase /site/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /site/index.php [L]
</IfModule>
# END WordPress

Options +FollowSymlinks

# RewriteEngine on
# rewritecond %{http_host} ^localhost [nc]
# rewriterule ^(.*)$ http://localhost/$1 [r=301,nc]

# protect wpconfig.php
<files wp-config.php>
order allow,deny
deny from all
</files>

Options +ExecCGI

<IfModule mod_security.so>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

Solution

  • According to WordPress Codex: Change File Permissions: You must chmod the .htaccess file to 666 to edit it with the WordPress template editor, but this is not recommended, since if you do that, any user of your blog, who can edit templates will be able to edit it. You can change the permissions to 660 to make it server-writable, which again will have the same limitation.

    Server Blockage: Your host might have blocked the SERVER_SOFTWARE variable and this will cause WordPress' .htaccess generation to fail. If you are sure that your server is running Apache, you can force WordPress to believe that your server is running Apache by changing your wp-includes/vars.php file. Follow the steps below to implement these changes.

    http://codex.wordpress.org/Using_Permalinks