Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/jackbor/public_html/blog/wp-content/plugins/headmeta.php on line 52

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/jackbor/public_html/blog/wp-content/plugins/headmeta.php on line 52

Permalinks for Pages in WordPress Made Simple

When I first fired up WordPress 1.5.1.2 I almost gave up on it prematurely because the new ‘Pages’ feature seemed to require two unacceptable options if I was to use permalinks (for more user-friendly urls):

  • chmod .htaccess to world writable
  • update .htaccess every time I wanted to add a new ‘page’

After some thorough searching through the forums, I came across some tips that solved the issue and made it possible to add pages without changing .htacess one bit.

(I found the solution before creating this blog, otherwise I’d provide a link to the source, but I can’t seem to recall where I found this info.)

<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php/$1
</ifmodule>

3 Responses to “ Permalinks for Pages in WordPress Made Simple”

  1. Bennett says:

    I never had this problem; my .htaccess permissions are 644, and I don’t have to do anything extra when I create a new page.

    It might depend on how PHP is installed. My host uses PHPsuexec (or is it suphpexec?) which causes the PHP process to run as me rather than the apache user. I think this is why my .htaccess doesn’t have to be world-writable.

    Your solution looks useful though — I wonder why we don’t hear more about this problem?

  2. Administrator says:

    I don’t know why you don’t hear about this more often. I guess folks just put up with it. Either that, or they’re using WordPress first and foremost for adding posts, not pages.

    With the addition of ‘pages’ WordPress seems to be adding CMS capabilities.

    Anyhow, here is a page in the codex that people can read for more information:
    http://codex.wordpress.org/Using_Permalinks

    And a post from a WordPress user experiencing the difficulties I described in my post.
    http://wordpress.org/support/topic/34953

  3. marco garcia says:

    hello, i found this WP SEO tip on http://blogging.typepad.com/how_to_blog/2004/08/how_to_configur.html

    and was wondering if i could use this with your plug in. the reason is that i want to have my permalinks named like the post. do you know if it will work fine? i’m freshly designing two sites (first time using WP) and i wanted to maximize my customers chances of getting visits.

    RewriteEngine On
    RewriteBase /
    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-]+).htm([0-9]+)?/?$ /index.php?name=$1&page=$2 [QSA]
    RewriteRule ^([_0-9a-z-]+).htm/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?name=$1&feed=$2 [QSA]
    RewriteRule ^([_0-9a-z-]+).htm/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]

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Calendar

June 2005
M T W T F S S
    Jan »
 12345
6789101112
13141516171819
20212223242526
27282930