WordPress.org

Forums

[resolved] Struggling with mod_rewrite (6 posts)

  1. abyte
    Member
    Posted 4 years ago #

    Hi, I considering changing over from a different CMS system and was trying out WordPress.

    I've get stuck with trying to make permalinks work correctly. I've read the guide at:
    http://codex.wordpress.org/Using_Permalinks

    This has left me confused as how to set things up. There are various menu options within the admin interface (default, day an name, month and name, etc). There are no options to use mod_rewrite.

    In my previous CMS, you manually edit the .htaccess file and config.php and its job done. Every single page has a URL based on its title, with an optional extension like .html at the end. This is all I am trying to achieve. So I'm after http://www.xyz.about.html, http://www.xyz.contact.html etc.

    Is it just as simple as putting %pagename% into the Custom Structure area? Is this OK, as there was a lot of reference to not using strings at the front of your URLs as it greats a lot of extra work for wordpress to distinguish posts from pages. I don't know if %pagename% counts as a string as its not listed in the tags in the codex area that I linked above.

  2. James Huff
    Volunteer Moderator
    Posted 4 years ago #

    Is it just as simple as putting %pagename% into the Custom Structure area?

    Almost.

    You'll want to make sure that you surround it with slashes and use a valid permalink structure tag (pagename is not a valid tag), like /%postname%/

    Otherwise, yeah, it's that easy.

    If WordPress cannot automatically edit the .htaccess file after saving your permalink settings, it will provide manual instructions.

  3. abyte
    Member
    Posted 4 years ago #

    Thanks for the fast reply :)

    I was going to try and avoid /%postname% as the codex I read warned of performance issues. Hence I was trying /%pagename% (which works). Is this better than /%postname% or am I going to start and run into performance issues once I get to sites with 100 pages (I have some with this many).

  4. James Huff
    Volunteer Moderator
    Posted 4 years ago #

    %pagename% is not a valid tag, and therefore shouldn't work, so I wouldn't use it. It might have been an oversight in a recent release and can be easily broken in a future release.

    Unless you have tens of thousands of posts, you won't notice any performance impact from /%postname%/

    If you're really concerned, I recommend /%year%/%postname%/

  5. abyte
    Member
    Posted 4 years ago #

    Wonderful, thanks for your help. All sorted now :)

  6. James Huff
    Volunteer Moderator
    Posted 4 years ago #

    You're welcome!

Topic Closed

This topic has been closed to new replies.

About this Topic