WordPress.org

Ready to get started?Download WordPress

Forums

Customizing Permalink Structure (15 posts)

  1. raptorstalkcom
    Member
    Posted 7 years ago #

    I had been using an older 2.0* release of WordPress, and just upgraded to 2.1. I recently discovered that you have a choice of permalink structure. I unfortunately am using the default structure of http://www.raptorstalk.com/?p=31, but want to change to http://www.raptorstalk.com/2007/03/24/no-respect-from-espn/. So the first link works, but the second doesn't. Is it possible to change the permalink structure if you already have published articles? If so, how do you do it? Or am I screwed here? Thank you in advance for any help you can provide.

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    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.

  3. raptorstalkcom
    Member
    Posted 7 years ago #

    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.

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    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.

  5. raptorstalkcom
    Member
    Posted 7 years ago #

    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 :(

  6. larsolsson
    Member
    Posted 7 years ago #

    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.

  7. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    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.

  8. raptorstalkcom
    Member
    Posted 7 years ago #

    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?

  9. larsolsson
    Member
    Posted 7 years ago #

    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?

  10. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    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.

  11. raptorstalkcom
    Member
    Posted 7 years ago #

    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.

  12. Will Taft
    Member
    Posted 7 years ago #

    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.

  13. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    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?

  14. raptorstalkcom
    Member
    Posted 7 years ago #

    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.

  15. adrianTNT
    Member
    Posted 6 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.