WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WP suggests same htaccess for diff permalink types! Bug?? (7 posts)

  1. ik80
    Member
    Posted 6 years ago #

    Independent on my permalink choice, WordPress always suggests the same htaccess configuration:

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

    I would like to have this permalink: /%year%/%monthnum%/%day%/%postname%/

    Didn't this need a htaccess like???
    RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?/?([0-9]+)?/?$ /blog/index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA]

    I'm running WP 2.3.1 on apache...

  2. moshu
    Member
    Posted 6 years ago #

    No.
    Don't touch the .htaccess.
    You set your permalink structure in your admin panel: Options > Permalinks.

  3. Michael Fields
    Themer
    Posted 6 years ago #

    ik80,

    Hi. You would be correct if wordpress handled the rewriting through htaccess alone - I believe in earlier versions this was true. In recent versions, wordpress uses a class to handle url rewritting: WP_Rewrite

    The htaccess that wordpress generates is always the same because all it needs to do is send any request that is not an existing file or directory to your index.php file and WP_Rewrite will take care of everything.

  4. ik80
    Member
    Posted 6 years ago #

    thanks people, so way cant i use any decent permalink structure (without /index.php/ ?)
    gonna read this WP_Rewrite...

  5. ik80
    Member
    Posted 6 years ago #

    what are the specifications to get pretty permalinks working besides having mod_rewrite enabled (which is ok on my server)?

    mod_rewrite permalinks require Apache's mod_rewrite module; people running WordPress on other server environments cannot use them. See Pretty Permalinks for more info.

    (source)

    Any permalink i try without /index.php/ (the almost pretty permalink) doesn't work... HELP please!!!

  6. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    To eliminate the index.php, you need:
    Apache
    mod_rewrite
    AllowOverrides enabled on the server (so that your .htaccess rules actually work)

    That's it.

  7. ik80
    Member
    Posted 6 years ago #

    thanks Otto42. Gonna check this specs with the server admin...

Topic Closed

This topic has been closed to new replies.

About this Topic