WordPress.org

Support

Support » How-To and Troubleshooting » Customizing Permalink Structure

Customizing Permalink Structure

Viewing 14 replies - 1 through 14 (of 14 total)
  • Moderator Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    Is it possible to change the permalink structure if you already have published articles?

    Yes.

    If so, how do you do it?

    Go to Options->Permalinks and select the new structure that you want to use.

    Thanks Otto, I actually did that, but when I go back to my tag, the articles that have been published don’t work. The link points to the new permalink structure, but the articles are only accessible via the old permalink structure. It does not update the urls automatically. it is very weird.

    Moderator Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    The articles are *always* accessible via the old permalink structure. That’s built in and cannot be altered.

    If the new permalink structure doesn’t work, then you could have an .htaccess problem. Check that your .htaccess file got created properly. Also, you do have to be on an Apache server box for this to work at all, so make sure you’re using Apache and not IIS. Also, some hosting servers (notably GoDaddy) has some weird process where new .htaccess files can take a while before they actually take effect. So wait an hour or two if you’re on GoDaddy hosting.

    it actually might have something to do with the .htaccess file. i don’t seem to have one in my server, and when i make that change in options>permalinks, it tells me to update that file. what the heck do i put in it? i don’t even know what an .htaccess file does 🙁

    Sorry I don’t have any answers for ya. In fact, I’m having the same problem you are. I just started my blog, so there aren’t a whole lot of posts (OK, only one) to have this problem, but it’s the same for me: under the default permalink structure, it works fine. If I switch to the “pretty” permalink structure, mousing over the link on the main page gives you the correct URL, but if you actually click on it, you get the Apache 404 error. Would love to see someone give an answer for this one, too.

    Moderator Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    WordPress will attempt to create the .htaccess file for you, but if it cannot, then it will tell you to do it and it should also tell you exactly what to put in that file. Scroll down when you update the permalinks to see the content of the file.

    You cannot have pretty permalinks without an .htaccess file.

    ok, so this is what i did. i turned on pretty permalinks in options. i ssh’d into my server, went to the root install directory for wordpress, i typed in:

    cat > .htaccess
    pasted: <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    control + d

    pretty permalinks still don’t work. what did i do wrong?

    Er, yeah. I did that. The contents of my .htaccess file are currently as follows:

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

    # END WordPress

    Should there be other things in there? And should this file’s name simply be .htaccess?

    Moderator Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    went to the root install directory for wordpress

    Is that also the root directory of your website? Or is it in some other subdirectory, like http://example.com/blog ?

    Are the permissions on your .htaccess file correct? 444 should be right.

    Is Apache actually configured to check the .htaccess files?

    Did you misname the file? Did you cat it to verify it saved correctly?

    The list of possible errors you’ve made is numerous, I cannot define them all.

    The root install directory for wordpress is also the root of my server (www.raptorstalk.com). Apache permissions are 444. I don’t know how to check if apache checks the .htaccess file. I didn’t misname the file, and it is saved correctly.

    I have had numerous difficulties with changing to a custom pretty permalink structure. This plugin:

    http://www.deanlee.cn/wordpress/permalinks-migration-plugin/

    helped fix most of them.

    Moderator Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    If you still can’t get it to work, talk to your host. The .htaccess seems correct to me, so I’d ask them why it’s not working. Is mod_rewrite enabled?

    Thanks for the help Otto42, everything you said to do was correct. The webhost had to enable some sort of overwrite or something, I didn’t understand. Great help though. Good karma dude.

    For others that have nice url and .htaccess problems: you might want to know that most Godaddy servers need half hour to detect a newly created .htaccess file. After this the changes are instant.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Customizing Permalink Structure’ is closed to new replies.