• I’m trying to get permalinks (day and name) working on a linux host with php 5.x and mod_rewrite loaded but get a 404. I’ve tried the relevant suggestions on the Using Permalinks page but it references things that I just don’t find w/ my WP install (2.9.1) such as WP’s built-in file editor (no biggie there) but also the “$is_apache = strstr($_SERVER[‘SERVER_SOFTWARE’], ‘Apache’) ? 1 : 0;” line in wp-includes/vars.php. I could find no such line in that file. Am I really that daft or was that codex page invalidated by an updated version?

    I had no .htaccess file and WP said it couldn’t write to it even after I’d made an empty one and set permissions to 644 so I cut & pasted the mod_rewrite rules by hand. I’m still getting a 404 on the posts’ pages. (The home page is showing up just fine.) It appears to be generating the permalinks properly in the address bar but it still reports 404.

    Hope someone has an answer for me.

    Thanks,

    –Allen

Viewing 4 replies - 1 through 4 (of 4 total)
  • All you need to do is visit Admin/Settings/Permalinks, set up your custom structure and save your changes.

    had no .htaccess file and WP said it couldn’t write to it even after I’d made an empty one and set permissions to 644

    Try making it writable.

    Changing_File_Permissions

    Hi,

    Set your desired permalink from wordpress admin area and then add this code in htaccess:

    # 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

    After that have a check with old and new posts of your blog.

    Thanks,

    Shane G.

    Hi Shane,

    It seems there really is something wring with the permalinks.
    Also the ErrorDocument 404 line seems not to work in my case.

    Maybe my problem adds information which can be usefull to fix this.

    The following happens at my site:

    —ONE—
    I start with no standard Permalink settings

    I’v uploaded an “empty” .htaccess file which contains:
    # BEGIN WordPress

    # END WordPress

    === RESULT ===> All works.

    —TWO—
    I enable the Permalink setting: /%category%/%postname%/

    My .htaccess file is changed automatically.

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

    # END WordPress

    === RESULT ===> The permalinks work EXCEPT for the main page !

    When using the WordPress Classic 1.5 theme, the line where the index.php ends is:
    <p><?php _e(‘Sorry, no posts matched your criteria. !’); ?></p>

    This is the index.php, I don’t feel confident enough to hack around in the php file in wordpress yet …

    Anyway, maybe this information is usefull for you.

    Here the index.php file:

    <?php
    /**
    * @package WordPress
    * @subpackage Classic_Theme
    */
    get_header();
    ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <?php the_date(”,'<h2>’,'</h2>’); ?>

    <div <?php post_class() ?> id=”post-<?php the_ID(); ?>”>
    <h3 class=”storytitle”>” rel=”bookmark”><?php the_title(); ?></h3>
    <div class=”meta”><?php _e(“Filed under:”); ?> <?php the_category(‘,’) ?> — <?php the_tags(__(‘Tags: ‘), ‘, ‘, ‘ — ‘); ?> <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__(‘Edit This’)); ?></div>

    <div class=”storycontent”>
    <?php the_content(__(‘(more…)’)); ?>
    </div>

    <div class=”feedback”>
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__(‘Comments (0)’), __(‘Comments (1)’), __(‘Comments (%)’)); ?>
    </div>

    </div>

    <?php comments_template(); // Get wp-comments.php template ?>

    <?php endwhile; else: ?>
    <p><?php _e(‘Sorry, no posts matched your criteria. !’); ?></p>
    <?php endif; ?>

    <?php posts_nav_link(‘ — ‘, __(‘« Newer Posts’), __(‘Older Posts »’)); ?>

    <?php get_footer(); ?>

    Hi All,

    I’ve done some testing, and as far as I can see the Permalinks (partly !) fails.

    in case the WordPress-adres (URL) differs from the Blogadres (URL).

    As soon as WordPress- and Blog address are the same, the Permalinks (completely !) work.

    As soon as WordPress- and Blog address differ, only the default Permalink (completely !)works, any other setting will cause problems.

    Please note Permalink settings only PARTLY fails !
    For example the links to pages are ok, the links to blogs fail.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Permalinks & 404’ is closed to new replies.