• Resolved morosophos

    (@morosophos)


    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 https://…/archives/zappa-err-zeta/ I get https://…/index.php/archives/zappa-err-zeta/. Taking out the “/index.php” out of the address bar goes to a 404 page.

Viewing 14 replies - 1 through 14 (of 14 total)
  • 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.

    Thread Starter morosophos

    (@morosophos)

    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.

    Thread Starter morosophos

    (@morosophos)

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

    Umm, do you have mod_rewrite on your server?

    Thread Starter morosophos

    (@morosophos)

    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.

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

    Thread Starter morosophos

    (@morosophos)

    I’m hosted on unix with apache 1.3.36

    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?

    Thread Starter morosophos

    (@morosophos)

    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.

    AllowOverrides is enabled?

    Thread Starter morosophos

    (@morosophos)

    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

    Thread Starter morosophos

    (@morosophos)

    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.

    Thread Starter morosophos

    (@morosophos)

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

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘“Almost-Pretty Permalinks” Won’t Get Pretty’ is closed to new replies.