WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] LocalHost: Permalink question (9 posts)

  1. trainermade
    Member
    Posted 5 years ago #

    I'm learning to tinker with wordpress on my localserver.

    As I go through the process of changing the kind of permalinks I want, I set it to just the post title with the /%postname%/.

    When this happens, none of my posts are accessible. They call come up 404. And this happens an all of the permalink options in the control pannel EXCEPT the default.

    Does anyone have any tips? As for now as I build this thing from scratch (based on a tutorial by killersites.com) my code as it relates to the permalink stuff and created a customized 404 notice that runs on the php server looks like this:

    <?php if ( have_posts() ) : ?>

    <?php while (have_posts()) : the_post(); ?>
    <div class="post">
    <h1>
    ">
    <?php the_title(); ?>

    </h1>
    <h2><?php the_author(); ?></h2>
    <p>
    <?php the_content('Read More...'); ?>
    </p>
    </div>
    <?php endwhile;?>

    <?php
    else:
    ?>
    <h2>Not Found</h2>
    <p>
    Sorry! I can't find what you're looking for
    </p>

    <?php
    endif;
    ?>
    </div>
    </div>

    Is the code wrong some how?

    To quick summarize the issue:

    Can't change the style of permalink (when I do it comes up 404 when I click on the post). So a post titled New Post should come up *localhost/trainermade/new-post* but it comes up a plain 404.

    Can't set the 404 error for a missing link such as (localhost/trainermade/asdlkjasl;dkjas;fdkj)

  2. MichaelH
    Member
    Posted 5 years ago #

    Can at least point you to Permalinks.

  3. Boris
    Member
    Posted 5 years ago #

    have you activated mod_rewrite on your local server? if you don't know, check your apache\conf\httpd.conf file for that line # LoadModule rewrite_module modules/mod_rewrite.so

    if it's got the # in front remove it and then stop apache and then start it again. permalinks should work then.

  4. trainermade
    Member
    Posted 5 years ago #

    TRAVEL-JUNKIE!!!! YOU ROCK! That was the easiest fix I've ever had someone tell me. THANK YOU!

    -Andrew

  5. MichaelH
    Member
    Posted 5 years ago #

  6. Boris
    Member
    Posted 5 years ago #

    glad i could help :)

  7. guvnrDOTcom
    Member
    Posted 5 years ago #

    for those of you with Apache2 running on Ubuntu (Jaunty at least), who've installed a LAMP server via tasksel, use this instead ..

    LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

    .. cos the dir changed :P

  8. Slennzer
    Member
    Posted 5 years ago #

    Travel-junkie, thank you so much! I was having the same problem on my local-host. Can't believe it was something this simple.
    I would have been going in circles if it wasn't for Travel-junkie & trainermade (who asked the question). =D

  9. wpweb
    Member
    Posted 4 years ago #

    I wonder how to do this on Mac? Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic