Forums

Changing permalinks causes all links to break (11 posts)

  1. AMSmith
    Member
    Posted 5 years ago #

    I had this problem months ago, but now that I've reinstalled WP to try the blog again, I've got the same problem. I've SCOURED the codex. Tried everything I could find in the threads.

    When I try to use ANY link form other than default, all the links break, including links to pages, full articles, authors, etc. If I go back to default a nd delete the .htaccess file, the links work.

    Help appreciated.

  2. Jeremy Clark
    Moderator
    Posted 5 years ago #

    Not to say that you didn't try this but just to cover the bases did you check to see if you htaccess file is writable by the web server. Also if you're running your own server what flavor of 'nix are you using because I had a problem with my server like this also it was the way apache was setup .

  3. ninjaboy
    Member
    Posted 5 years ago #

    I had exactly the same thing happen to me when I started with WP - permalinks are a very important feature for your website/blog, they are worth a bit of sweat and tears to get working!

    Im running on FreeBSD/Apache and found that I had to put the following in my .htaccess and then make it NOT writable. This has been used on lots of WP installs and works fine for me.

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

    I think the main difference between this and the standard WP .htaccess (from memory) is the line:

    Options +Followsymlinks

    I set the permalink options in WP, then replace the text in the .htaccess file with the above and make the file NOT WRITABLE - if the file is overwritten by WordPress it breaks the site every time! I'm then able to change the WP permalink structure (or update it if a plugin requires) no problem. WP warns that you need to update .htaccess (because it couldn't write to it) but I don't and it always works fine for me with many WP installs!

  4. Otto
    Tech Ninja
    Posted 5 years ago #

    If you just did this:

    Options +Followsymlinks
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    ...

    Then you'd get the same effect and you wouldn't have to make the file non-writable. WordPress will only overwrite it's own rules, between the begin and end lines.

  5. ninjaboy
    Member
    Posted 5 years ago #

    Ahh, good tip and I know it should work like that, but I had trouble with my .htaccess with it left writeable, especially when I had one site with password protection on a directory - it really screwed up then!

  6. AMSmith
    Member
    Posted 5 years ago #

    Thanks so much for the input. I just tried both ways and neither worked. I've got .htaccess chmoded to 644. Should it be something else?

    Here is what I have in the file (also tried it with Options... inside the WP code:

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

    I did figure out one thing. The code generated by the Options>Permalinks page does NOT include:

    # BEGIN WordPress
    or
    # END WordPress

    I tried using the code without it first, then added it. Still, no go.

  7. doodlebee
    Member
    Posted 5 years ago #

    Does your host have mod_rewrite enabled? It won't matter what you do to your .htaccess file if your host doesn't have mod_rewrite enabled for you.

  8. AMSmith
    Member
    Posted 5 years ago #

    I thought it was. :/ We host our own servers but the sysop is out of town. How can I check?

  9. AMSmith
    Member
    Posted 5 years ago #

    I just found this mod_rewrite test:

    http://www.wallpaperama.com/forums/how-to-test-check-if-mod-rewrite-is-enabled-t40.html

    Link one says, "You are not using mod_rewrite."

    Link two goes to a 404 error page.

    Guess I have to check that tonight.

  10. AMSmith
    Member
    Posted 5 years ago #

    Checked it. mod-rewrite is enabled...and always has been. Any suggestions now?

  11. AMSmith
    Member
    Posted 5 years ago #

    Didn't ever get the pretty links to work. Finally tried the almost pretty links and that works. Wish I knew why because I prefer not to have the additional "baggage" in the URL.

    .htaccess is writabe. mod_rewrite is enabled.

    Anyone have a clue?

Topic Closed

This topic has been closed to new replies.

About this Topic