• My current URI structure is /archives/%year%/%monthnum%/%day%/%post_id%/%postname%/ but I’ve noticed other users skip the initial /archives part. Is there any advantage to keeping it? If not, is there any way to “grandfather” the old links that still have “/archive” in them? I’m looking for some general rule that will make /archive/foo redirect to /foo.

Viewing 3 replies - 16 through 18 (of 18 total)
  • Update: I’ve sorted my problem out. There was a conflict between the rewrite rules for individual archives and category archives. I had my individual entry permalinks set up as /archives/%year%/%monthnum%/%day%/%postname%/ and my category archives set up as /archives.

    By changing the category archive base to /archives/category, I managed to solve my dramas, without having to use any rewrite rules imported from an old copy of WP.

    So there you go. Not a biggy at all, but one that took me about 4 hours to figure out. I did learn a lot about mod_rewrite and regex in the process, though, so it wasn’t a complete waste of time.

    (And also for reference, copying the old rewrite rules over fixed the individual archive problems, but broke category and monthly archives, but this may have been a function of the heavily-hacked .htaccess I currently use.)

    OK. I have been struggling with Permalink issues since the start of the year. This is the first of the many, many posts I’ve read that actually helped. It led me to stumble on what I think was the reason my permalinks weren’t working, and hopefully this might help other people with the same problem.

    First of all I updated my permalink settings to /archives/%year%/%monthnum%/%day%/%postname%/ and my category settings to /archives/category

    I updated .htaccess via the WordPress template interface. All my archive and category links then immediately broke. But something niggled. I ftp-ed into my site and looked at the .htaccess files, both in the root where I keep the index.php and in my /wordpress directory. Neither of them had been updated. Weird. I went back to the template interface, scrolled down to ‘Common Files’ and moused over where it says ‘.htaccess (for rewrite rules)’ to see where it linked to (so I could try and find out exactly what it was updating).

    The link was to:
    https://www.miaowthecat.com/wordpress/wp-admin/templates.php?file=.htaccess

    I am not a PHP or WordPress guru by any distant stretch of the imagination, so this didn’t make much sense to me. What I did instead was make a new .htaccess file with my new settings (thank you Cam) and uploaded them to my root directory and my wordpress directory. I could not BELIEVE it. My permalinks all worked. Shock and awe. Naturally I couldn’t leave it alone. I tried changing my permalink settings to:
    /wordpress/archives/%year%/%monthnum%/%day%/%postname%/ and
    /wordpress/archives/category

    I uploaded it again via FTP and everything broke. OK. So it doesn’t like the ‘wordpress’ directory thing. I decided I could definitely live with that, and fixed back up to how it was working before. I am happy ??

    Moderator James Huff

    (@macmanx)

    FYI, The link: https://www.pretenddomain.com/wordpress/wp-admin/templates.php?file=.htaccess means that it is going to go to templates.php and call .htaccess to be displayed when it gets there. You’ll see a lot of that when working with WordPress and PHP in general.

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘changing URI structure’ is closed to new replies.