• Resolved tmcconnon

    (@tmcconnon)


    Hello all –

    We’ve installed WordPress 2.9.2 in a subdirectory named /university/.

    If we change the permalink structure to anything other than ‘default’ and try to view a page, we get a 404. The .htaccess file permissions are currently set to 0666, and when I change the structure WordPress appears to accept it (with the message “Permalink structure updated”). With the custom permalink structure, the .htaccess file reads:

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

    Why in the world are we still getting 404s?

    – We’ve dropped the database, created a new one and imported the data. No change
    – We’ve overwritten the current version of WordPress with a fresh install. No change.
    – We’ve deactivated all the plugins. No change.

    Can anyone see or think of anything we’re missing?

    Thanks!

Viewing 12 replies - 1 through 12 (of 12 total)
  • Is mod_rewrite installed on the server?

    Thread Starter tmcconnon

    (@tmcconnon)

    Thanks for the reply Esmi!

    It is…in fact permalinks are working just fine on other WordPress installs on the same server. Any other ideas?

    put .htaccess into /university/?

    Thread Starter tmcconnon

    (@tmcconnon)

    Yes sir! The .htaccess file is found in that directory.

    Have you tried switching to the default theme?

    i have this in /etc/apache2/httpd.conf

    # For wordpress
    <Directory />
    Options FollowSymLinks
    AllowOverride All
    </Directory>

    <Directory <path_to_www>/university>
    # … other directives…
    AllowOverride All
    </Directory>

    (but i add “university” for your convenience.)

    Thread Starter tmcconnon

    (@tmcconnon)

    @esmi – I did, still didn’t work with the default theme.

    Thread Starter tmcconnon

    (@tmcconnon)

    @oznola looking into that code right now – I’ll get back to you in a minute

    Thread Starter tmcconnon

    (@tmcconnon)

    @oznola – this is what we have, which works ok with our other install on the same server:

    <Directory /usr/local/www/www.********.com>
    Options Indexes SymLinksIfOwnerMatch
    AllowOverride Options FileInfo
    Order allow,deny
    Allow from all
    </Directory>
    alias /university "/usr/local/www/*******-wordpress"
    <Directory "/usr/local/*******-wordpress">
    Options Indexes MultiViews FollowSymlinks
    AllowOverride Limit Options FileInfo
    
    Order Allow,Deny
    Allow from all
    </Directory>

    you have aliased “/usr/local/www/*******-wordpress” to /university but it appears to be unused (no big deal).

    then i presume wordpress is installed in /usr/local/www on both machines?

    copy httpd.conf to http.conf1 (.conf-one for a backup) and then comment out the second <Directory> directive and add <Directory /university> below it.
    now you will be using the alias. ??

    then run
    #apache2ctl restart (as root).

    then try you permalinks again.

    i believe what i have suggested it what the original author intended for the wordpress section in httpd.conf.

    in the mean-time i will look into what the other options you have in httpd.conf for wordpress are. it appears that the author of your httpd.conf was trying protect your wordpress files like password files.

    the wordpress codex recommends a httpd.conf section for wordpress similar to what i have.

    if the adjustment suggested do not work then comment out everything in the wordpress section of httpd.conf and try adding a section similar to mine underneath it but with paths relevant to your system. assuming the /university alias is correct you can use /university instead of the literal path.

    if you get tired of that sort of tinkering you can copy httpd.conf to httpd.conf2 and then copy the original httpd.conf1 back to httpd.conf.

    also, you have to run apache2ctl restart every time you make a change to httpd.conf.

    here is where i am getting the info on configuring httpd.conf https://httpd.apache.org/docs/2.2/sections.html

    also try…

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

    # END WordPress`

    for .htaccess with the original httpd.conf and its permutations.

    Thread Starter tmcconnon

    (@tmcconnon)

    @oznola – I can’t thank you enough for your help. From your feedback we identified that:

    /usr/local/******-wordpress

    should have been:

    /usr/local/www/******-wordpress

    It was an oversight on our part, but it’s fixed and working perfectly now! Thanks again for all the time you volunteered toward fixing our issue.

    Best,
    Tom

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Custom Permalinks Serving 404 Pages’ is closed to new replies.