• I realise this appears to be a much-discussed topic, but I haven’t been able to find a solution that works for me and would greatly appreciate any help!

    I’m running a local WP install (2.9.1) on OS X (10.6.2), via MAMP. When I change the permalink structure (to anything at all) I get a 404. I’ve created a .htaccess file for the folder (I didn’t have to with the last website [that I built with 2.9.0 if it makes any difference!]) with all the documented code I found on the codex. I tried also changing my ‘AllowOverride None’ to ‘All’ at ../MAMP/conf/apache/httpd.conf which was mentioned on another post.

    Don’t know where to go from here!

Viewing 13 replies - 1 through 13 (of 13 total)
  • Make sure mod_rewrite is enabled, if it is, then try adding the symlinks option to your htaccess..

    Options +FollowSymLinks

    also in your apache httpd.conf file look that this line has the hash mark removed to un-comment it
    #LoadModule rewrite_module modules/mod_rewrite.so

    Thread Starter Richard Sweeney

    (@theorboman)

    Thanks for the tips!

    Although I failed to mention it in my post, I have already tried both of your suggestions… to no avail I’m sorry to say.

    Cheers anyway!

    So does mod_rewrite show up as a loaded module if you do a phpinfo();.

    Thread Starter Richard Sweeney

    (@theorboman)

    Yeah, it does. I’m very puzzled!

    If your WP install is in a sub-directory are there any htaccess files in the folders above, if so, do they have anything in them, anything non-wordpress or custom?

    Have you tested a custom rewrite rule in htaccess? , to determine whether mod_rewrite is working, it need only be something basic.. (i can provide something to test if you like)..

    Thread Starter Richard Sweeney

    (@theorboman)

    Well, I messed around with permissions a bit (nearly went badly for a while!) and managed finally to make it work!

    I also made a .htaccess file for the enclosing folder. Not really sure what made it all work, but it seems to be working fine now.

    Thanks for all the friendly help and advice. Very much appreciated.

    If anyone’s reading this thread let me re-confirm my current settings in the hope that they might help! I’ve created 2 .htaccess files, one at the site root and the other at the root of the enclosing folder (my Sites folder). Both have the following code:

    <IfModule mod_rewrite.c>
    
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{REQUEST_FILENAME} ^wp-content.*
    RewriteCond %{REQUEST_FILENAME} ^wp-admin.*
    RewriteCond %{REQUEST_FILENAME} ^wp-include.*
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    I didn’t have to change my httpd.conf file with MAMP.

    Hi,

    First you need to set your desired permalink from wordpress admin area and then need to edit the httpd.conf/htacecess or rewrite rule file and add this wordpress rewrite rule:

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

    Thanks,

    Shane G.

    Shane,
    after six or seven unsuccessful attempts, garnered from all over the web, to change my permalink from default to postname, without loosing RSS feed that is, your above script for .htaccess did the trick at first attempt. The given example in 2.9.1 wouldn’t do it. I’m sure you can imagine my relief, many thanks.
    Ernst
    if code is poetry, it sure don’t rhyme

    Oh well, didn’t work properly after all. RSS feed OK in Firefox, IE only gibberish. Back to the drawing board.
    Ernst

    Well – I had the same problem – but even after making all the changes to .htaccess, etc I was still getting a wordpress 404 (vs an apache 404).

    Oddly, somehow the Blog address (URL) setting (in general settings) had a space added to it – which was throwing everything off – I don’t know how it got there -but I thought I’d mention it in case it can save someone some hairpulling…

    I had the same problem with MAMP and a vhost I setup for local development. The wordpress front page and /wp-admin/ worked but any sub pages, etc. failed to load. When trying to access a WordPress page at url https://site.local/music/ The error in the apache logs was:
    [Thu Aug 26 12:11:31 2010] [error] [client 127.0.0.1] File does not exist: /Users/lantrix/devel_projects/vhosts/site.local/music

    I had made sure that mod_rewrite was enabled as mentioned by Samuel B above. I had also ensured I had updated the permalinks in the local WordPress install, thus writing out a .htaccess for the rewrites. Still no luck.

    Then I remembered, one needs to tell Apache that a directory outside the webserver root /Applications/MAMP/htdocs, in this case my vhost path of /Users/lantrix/devel_projects/vhosts/site.local, needs to have an AllowOverride so the .htaccess WordPress has placed can be used. This in combination with the apache Options directive to FollowSynLinks as mentioned by Mark worked for me. No more 404 errors!

    Here is the vhost configuration at the bottom of my MAMP apache config file /Applications/MAMP/conf/apache/httpd.conf which works for me, but YMMV:

    NameVirtualHost *
    <VirtualHost *>
            DocumentRoot "/Users/lantrix/devel_projects/vhosts/site.local"
            ServerName site.local
            ServerAlias www.site.local
            DirectoryIndex index.php index.html
    </VirtualHost>
    <Directory "/Users/lantrix/devel_projects/vhosts/site.local">
            AllowOverride All
            Options -Indexes +FollowSymLinks
            Order allow,deny
            Allow from all
    </Directory>

    I just wanted to thank lantrix for his post and confirm his solution did work in my case. I’m running MAMP 1.9 in OS X 10.6 and using VirtualHostX. Editing the httpd-vhosts.conf file resolved the problem in my case.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Change permalinks = 404 Local Mamp Installation’ is closed to new replies.