• I’m running an instance of WordPress through an Apache server I’ve used for development for several years now on my Windopes 7 notebook – i7 quadcore. I custom installed it not using Mamp or Xammp.

    WordPress is installed in it’s own directory in a folder called bigsurwebdesign. I copied the index.php and .htaccess files into the root directory making the appropriate change to the path in the index.php file. I have configured Apache (httpd.conf to allow “mod_rewrite”) as I customized the “permalinks” /%category%/%postname%/. The URL in the common settings list is https://localhost/bigsurwebdesign/

    When on the page I call “Home” (the “static” page) and click on “Recent Posts” in the sidebar I get a 404 error “The requested URL/bigsurwebdesign/introductions/test-test-test/was not found on this server. The path in the address bar is right – “localhost/bigsurwebdesign/introductions/test-test-test/” but can’t find the page. If I change the permalinks back to the default setting
    of “https://localhost/bigsurwebdesign/?p=123” it works fine – but with the pointless URL which I don’t want.

    I’ve made several posts in the “Dashboard” making sure they’re published but still no luck.

    Can someone tell me what I’m doing wrong, or what the problem might be?

    My local server’s not set up to be accessed from the www so I can only give you the address of the WordPress instance on my host provider’s server which is BigSurWebDesign which works fine so far.

    Thanks in advance,
    sonofadoc

Viewing 14 replies - 1 through 14 (of 14 total)
  • Phil

    (@owendevelopment)

    URL rewrites enabled for Apache? Like mod_rewrite?

    Thread Starter sonofadoc

    (@sonofadoc)

    * I have configured Apache (httpd.conf to allow “mod_rewrite”)*

    Phil

    (@owendevelopment)

    OK. Hmm.

    Not to state the obvious, but did you check permissions on your htaccess file? ie, does WordPress have the permission to alter the permalink structure in the htaccess?

    Also, when you change to /%category%/%postname%/, does the htaccess look (similar) like this?

    # 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

    I’m having a similar experience on several internal local test sites. My permalink requests for settings other than default return 404 Errors. I can see that settings changes in the permalinks page results in mod_rewrite changes to the .htaccess file. Only the Default setting returns the pages.

    My sites are running on CentOS Apache. Below is the way the mod_rewrite is added to my site in MAMP.

    # 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
    Thread Starter sonofadoc

    (@sonofadoc)

    It looks to me like I have full permissions in Windows 7 which I gather is equivalent to 777 in Unix. I’m not clear on this and I don’t know how to set the permissions on local Apache. I know how to do it in the Apache server on my web host via my FTP client. So the answer is – I’m not sure except Windows 7 says I have full control of the file. Here is the .htaccess file:

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

    # END WordPress

    I’ll hold off to see is @sonofadoc finds a solution.

    Phil

    (@owendevelopment)

    OK.

    Can you double-check inside another file: Apache > Conf
    Locate the file httpd.conf. Open that in a text editor.

    Find “rewrite”. The line you need looks like this:

    #LoadModule rewrite_module modules/mod_rewrite.so

    You sometimes need to take away the hash sign so it looks like this

    LoadModule rewrite_module modules/mod_rewrite.so

    Save and test if it makes any difference.

    Thread Starter sonofadoc

    (@sonofadoc)

    I have done this Phil. That falls under the category of:

    * I have configured Apache (httpd.conf to allow “mod_rewrite”)*

    which means I have removed the hash tag.

    Phil

    (@owendevelopment)

    Hmm. OK. Check that AllowOverride is set to All:

    AllowOverride All
    Thread Starter sonofadoc

    (@sonofadoc)

    I’ve go to run Phil. I’ll have to get back to this. Thanks for your help. I’ll be back.

    sonofadoc

    Thread Starter sonofadoc

    (@sonofadoc)

    Here are the default setting I found and the 2 instances of “AllowOveride” in the httpd.conf file for AllowOverride. Wherever it says ,AllowOverride None’ I replaced none with ‘All’. I still get the 404 error.

    # AllowOverride controls what directives may be placed in .htaccess files.
        # It can be "All", "None", or any combination of the keywords:
        #   Options FileInfo AuthConfig Limit
        #
        AllowOverride None
    
    <Directory "C:/Apache/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>
    
    #
        # Controls who can get stuff from this server.
        #
        Order allow,deny
        Allow from all
    Thread Starter sonofadoc

    (@sonofadoc)

    Here’s the changed code in the httpd.conf file:

    ServerRoot "C:/Apache"
    
    DocumentRoot "C:/webpages"
    
    <Directory />
        Options FollowSymLinks
        AllowOverride All
        Order deny,allow
        Deny from all
    </Directory>
    
        # AllowOverride controls what directives may be placed in .htaccess files.
        # It can be "All", "None", or any combination of the keywords:
        #   Options FileInfo AuthConfig Limit
        #
        AllowOverride All
    
        #
        # Controls who can get stuff from this server.
        #
        Order allow,deny
        Allow from all
    
    </Directory>
    Thread Starter sonofadoc

    (@sonofadoc)

    Something I’m just now realizing which I don’t think is right on taking another look at the .htaccess file on my local server and comparing it to the one in my public_html folder on my host server. Here’s the file on my host server where the custom permalinks work:

    # 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

    and here’s the one on my local server where I get the 404 error:

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

    I don’t know how the .htaccess file really works so it’s difficult to wrap my head around it, but this .htaccess file is located in a directory called “bigsurwebdesign” along with the wordpress directory. So, it seems to me these paths to bigsurwebdesign directories are wrong.

    On that note here’s a question I’ve wondered about for some time. Is . / the same as ../ or up one directory?

    Thread Starter sonofadoc

    (@sonofadoc)

    I copied and pasted my .htaccess file on my host server replacing the one on my local server to see what would happen. Nothing changed and nothing broke. Exactly what do these .htaccess files do? Same 404 error unless I change the permalinks to the default.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Permalinks-URL Not Found’ is closed to new replies.