Forums

[resolved] "Almost-Pretty Permalinks" Won't Get Pretty (15 posts)

  1. morosophos
    Member
    Posted 3 years ago #

    I'm updating my permalink structure to:

    /archives/%postname%/

    I put this under the "custom" field on the permalinks configuration page in the dashboard. I edited my .htaccess file thus:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?category_name=$1&feed=$2 [QSA]
    RewriteRule ^category/?(.*) /index.php?category_name=$1 [QSA]
    RewriteRule ^author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?author_name=$1&feed=$2 [QSA]
    RewriteRule ^author/?(.*) /index.php?author_name=$1 [QSA]
    RewriteRule ^([_0-9a-z-]+)([0-9]+)?/?$ /index.php?name=$1&page=$2 [QSA]
    RewriteRule ^([_0-9a-z-]+)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?name=$1&feed=$2 [QSA]
    RewriteRule ^([_0-9a-z-]+)/trackback/?$ /wp-trackback.php?name=$1 [QSA]
    RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1 [QSA]
    RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1&withcomments=1 [QSA]
    </IfModule>

    All the links work absolutely fine, except for the part where they are not pretty as I intended them to be. For example, instead of http://.../archives/zappa-err-zeta/ I get http://.../index.php/archives/zappa-err-zeta/. Taking out the "/index.php" out of the address bar goes to a 404 page.

  2. viitoria
    Member
    Posted 3 years ago #

    Instead of the long chain of things in the .htaccess, change it to this:

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

    # END WordPress

    Save, and permalinks *should* work.

  3. morosophos
    Member
    Posted 3 years ago #

    I edited my .htaccess file as you directed, but all the links on the blog still contain the /index.php/ prefix. However, manually removing the /index.php/ from the address and querying it shows that the page actually does work. However, it's not the URI contained in the links. Everything is still passed through the index.php.

  4. morosophos
    Member
    Posted 3 years ago #

    And on an additional note, if it makes any difference, I do have installed the WP 2.0.3 tuneup plugin.

  5. Viper007Bond
    Member
    Posted 3 years ago #

    Umm, do you have mod_rewrite on your server?

  6. morosophos
    Member
    Posted 3 years ago #

    I think mod_rewrite is present, because what I've put in the .htaccess still works to some extent, just not in the way it's supposed to.

  7. sadish
    Member
    Posted 3 years ago #

    probably you are hosted on a windows server and not a linux server ?

  8. morosophos
    Member
    Posted 3 years ago #

    I'm hosted on unix with apache 1.3.36

  9. Chris_K
    Administrator
    Posted 3 years ago #

    When you go to your Options -> Permalinks settings, and change something, does WP display what should be in your .htaccess? If no, click "Update Permalinks" to be sure what you manually added wasn't goofed(that means your .htaccess is read/writeable by WP)

    If WP gives you the "if this file was writable" message, carefully copy/paste what is provided to the .htaccess in your main blog directory.

    Now, what Permalink type do you have selected under "Common Options"? Do you have anything under "Optional" for Category Base?

  10. morosophos
    Member
    Posted 3 years ago #

    The commmands WordPress instructs me to enter into my .htaccess file are as follows:

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

    It seems to me like I should take out the /index.php/ from both the RewriteBase command and the RewriteRule command. After I tested the site with the .htaccess file exactly as WordPress suggested, I took them out and doing so didn't change anything, where all the links pointed to ".../index.php/..."

    The setting under my common options is the "Custom structure" option with /archives/%postname%/. I'm not currently using anything for my category base.

  11. Chris_K
    Administrator
    Posted 3 years ago #

    AllowOverrides is enabled?

  12. morosophos
    Member
    Posted 3 years ago #

    Aha! That it is not. What overrides should be enabled? I tried using

    <Directory />
    AllowOverride All
    </Directory>

    in the .htaccess file in the blog directory, but then I got an error 500—"Internal Server Error." My inexperience in dealing with apache on almost any level may mean there's something else in the .htaccess that may be causing it, or maybe there's something elsewhere. Here's my .htaccess as it stands now:

    # -FrontPage-

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    DirectoryIndex index.php

    <Directory />
    AllowOverride All
    </Directory>

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

  13. Chris_K
    Administrator
    Posted 3 years ago #

  14. morosophos
    Member
    Posted 3 years ago #

    I removed all FrontPage extensions (though it didn't look like there were any to begin with... the only trace of FrontPage I could find was the one comment in the .htaccess file. I re-uninstalled FrontPage nonetheless and tried it again to no avail.

  15. morosophos
    Member
    Posted 3 years ago #

    Nevermind, y'all. I backed up my data and reverted to WordPress 2.0.2, and everything works fine.

Topic Closed

This topic has been closed to new replies.

About this Topic