WordPress.org

Ready to get started?Download WordPress

Forums

Need help with htaccess and Peermalinks, please? (7 posts)

  1. EdNerd
    Member
    Posted 2 years ago #

    I just upgraded to WP 3.3.
    My WP install is at http://www.Domain.com/blog.
    In my site control panel, it's at /poublic_html/blog.

    I set my Permalink settings to Month and Name.
    The following code appeared: /%year%/%monthnum%/%postname%/
    I'm expecting this to generate a post name like domain.com/blog/2011/12/postname

    A message tells me to update my HTACCESS file with the following:

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

    (HTACCESS is in my root directory, not the /blog/ directory.)

    I read other posts saying to edit the HTACCESS code because I'm not at root.
    I came up with this:

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

    Unfortunately, my computer can't find my posts!
    Not VIEW, not PREVIEW.

    I know this has been answered a thousand times!
    I just can't find the answer that fixes my situation.
    A drop-kick in the right direction is greatly appreciated!!

    Ed

  2. Remove the index.html/ from your RewriteBase.

  3. EdNerd
    Member
    Posted 2 years ago #

    So when WP is not installed in the root domain directory, RewriteBase specifies the WP directory - yes??

    I see two RewriteRule commands. A previous post on this subject said to remove the slash from in front of "/index.php". I didn't touch the first RewriteRule. The second was originally ". /index.html/index.php [L]"

    I did remove the first slash - before index.html. Should I also remove the second slash - before index.php? Do I need both index pages called out?

    Ed

  4. EdNerd
    Member
    Posted 2 years ago #

    Okay - I ran across a blog post that described how to set your post permalink to postname followed by post ID. I liked that, and I tried to implement that, but I still can't see my posts.

    Here's what I did:

    -- Set my Permalinks Custom Structure to
    /blog/%postname%-%post-id%/

    -- Put the following in my .htaccess

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

    Note that I did remove INDEX from the RewriteBase.
    I also removed the initial / from the RewriteRule at teh bottom, but I'm not sure I got that right.

    If someone could please help me straighten this out, I'd greatly appreciate it.

    Ed

  5. EdNerd
    Member
    Posted 2 years ago #

    Found one issue - changed the permalink structure to ?%post_id%/.

    I piblished a post and the URL showed as
    http://familyfunmagic.com/index.htm/blog/reviews-of-birthday-options-in-yuma-an-introduction-49/

    But when I hit Preview or View Post, it looked for:
    http://familyfunmagic.com/index.htm/blog/reviews-of-birthday-options-in-yuma-an-introduction-49/

    And when I typed in the first URL manually, it could not be found.

    Any solutions?
    Ed

  6. EdNerd
    Member
    Posted 2 years ago #

    Okay - big question:
    This htaccess file that I'm modifying ...
    Is it in my root directory? Or the blog directory?

    Ed

  7. EdNerd
    Member
    Posted 2 years ago #

    Resolved by deleting and reinstalling WP.
    Thanks for all the help. (*koff koff*)

Topic Closed

This topic has been closed to new replies.

About this Topic