Forums

Implementing pretty permalinks without %postname% (6 posts)

  1. fredriley
    Member
    Posted 1 year ago #

    I know, I know, this must be a FAQ, but I can't find a satisfactory resolution of it despite searching for the last hour and a half. I need to set up 'pretty permalinks' for a site I'm transferring to WP, to use WP as a CMS. There's a long and detailed document called "Using Permalinks" which I've read closely.

    Essentially, I'm trying to replicate the site structure of my static site. So I'm after links such as:

    <host>/about/
    <host>/join/

    etc. It looked like using a custom permalink %postname% would do the job, and this is what I've used, but according to the fine manual:

    For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields

    I'm not creating a blog so the various date-related options in the Dashboard aren't appropriate, and I don't want numeric URLs because they've no human meaning. I've tried using the following in the .htaccess in the WP root:

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

    as recommended in the support doc, and this does seem to do something, as without it, using %postname% as a base, everything but the home page returns a 404 (as reported in this post). Even reading the Apache manual on mod_rewrite I still can't see what the above is supposed to do anyway.

    So the question is: how can I implement pretty permalinks like this without using %postname% or %category%? If I can't, then I'll just have to put up with the performance hit.

    I've looked in the FAQ, and I've searched the fora for "pretty permalinks" and looked at topics in the first two result pages (there are 000s of results and only a limited lifespan), without finding anything directly useful. I'd be grateful if someone could point me in the right direction. Plainly this is possible because many WP sites implement it, and I suspect it'll be really easy to do.

    Fred

  2. lashbrooke
    Member
    Posted 8 months ago #

    Hi Fred,

    Did you get anywhere with this as I am having the same issue.

    Cheers
    Sharon

  3. fredriley
    Member
    Posted 8 months ago #

    Nope, I'm afraid not, Sharon - the issue remains unresolved.

    If any Worpdress serfs are reading this, it took me 15 mins of faffing about to post this reply due to the 'password reset' in June, and I can't save the login in Firefox because as soon as I hit login and FF displays the 'remember password' dialogue, it also displays the stupid 'some parts of this page are not encrypted' dialogue which kills the password dialogue. Try not to do this in a hurry again, eh, guys? Please?

  4. Eric3D
    Member
    Posted 8 months ago #

    I have been using %category%/%postname% with no performance issues on many sites. The doc you referred to talks about potential problem with "sites with lots of Pages", which is not your case.

    If your .htaccess file is writeable, you just have to save the permalinks settings. If it's not writable or does not exist, you'll have to copy the code on the permalinks settings page and manually modify (or create) the .htaccess file.

  5. fonglh
    Member
    Posted 8 months ago #

    Actually, since you're creating pages, the actual setting you use is irrelevant.

    Use one of the date ones, since you aren't using posts, the numbers won't show up on the pages.

    The %postname% performance problem has been solved and will be available in 3.3.

  6. fredriley
    Member
    Posted 8 months ago #

    Thanks to both the recent posters, who've set my mind at rest.

Topic Closed

This topic has been closed to new replies.

About this Topic