Forums

Permalinks, htaccess and 500 errors -- I crashed my system (20 posts)

  1. nosab3
    Member
    Posted 4 years ago #

    I am a newbie to Wordpress, and in an attempt to fix a problem, I think I started a chain of events that has now led to a 500, internal error. I hope to recreate the situation so that you guys can help. I've checked other boards, and I am getting such mixed answers I thought I'd put it all in one place.

    1) The comments weren't showing up. I could see the number of comments per post, but the link to the comments page (post page) didn't show the comments or a place to put them.

    2) So I changed the permalink via admin -> options to resemble the only way I could view comments: when the link was sent through email (thanks Subscribe2 plugin!) "?=%postnum%"

    3) This change causes a 500 error. When I check the server log, it says:

    RewriteRule: cannot compile regular expression '^?=category/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$'\n

    4) So Now I'm in an EVIL cycle: to solve the 500 error, I delete the .htaccess file and put a new (blank) one there. Then the site comes back up, and as I go to admin->options, permalinks, that same faulty permalink is there, and then the system crashes again, without giving me a chance to change it. So I go to copy a start a new .htaccess, and start the cycle over.

    I think if I can clear the SQL or cache of that faulty permalink structure, then it won't come back up when I put in a new .htaccess. Obviously that data is being saved somewhere else. But how do I do that?

    And once I get the system back up and running, how do I fix the comments so they work.

    I'm running version 1.5.

    Thanks for the help!

  2. whistlerke
    Member
    Posted 4 years ago #

    Are you sure your server has mod_rewrite?

    Change the ?=%postnum% into /%postnum%

  3. moshu
    Member
    Posted 4 years ago #

    Try to make it work first without "nice" permalinks. Delete the .htaccess file (do not upload a new one); go to the Options > Permalinks and delete everything from the fields > click Update.

  4. nosab3
    Member
    Posted 4 years ago #

    Thanks for the suggestions. It still doesn't work.

    Everytime (including when I delete the .htaccess file) I get to options --> permalinks and then click "update" I get a 500 internal server error, and it stays no matter what else I do on teh site.

    It's not letting me change the bad permalink to a different one through the admin tool.

  5. vkaryl
    Member
    Posted 4 years ago #

    Did you highlight and then delete everything in the field at the bottom of the page before clicking the update button?

  6. nosab3
    Member
    Posted 4 years ago #

    yes I did.

  7. vkaryl
    Member
    Posted 4 years ago #

    Well, here's what I would do. I'd delete the .htaccess file again, then reupload wp-admin/options-permalink.php from the original download distro. Then take a look, see if you're back to square one "normal"....

  8. nosab3
    Member
    Posted 4 years ago #

    One solution I also tried was to delete all the PHP files besides WP-Content folder and config, index and comments.

    But then when I get to the options-->permalinks page the bad permalink has already populated the field. My guess is it's getting stored somewhere else.

    Where else would the permalink be stored that I can delete it manually, without relying on the online admin tool?

    thanks.

  9. vkaryl
    Member
    Posted 4 years ago #

    Hmm. In the database maybe.... let me go look at mine.

    Added: nope, nothing that I can see offhand.... hopefully Podz or Skippy will have a better idea for you....

  10. nosab3
    Member
    Posted 4 years ago #

    vkaryl -- thanks for the quick response. STill no luck, sadly.

  11. vkaryl
    Member
    Posted 4 years ago #

    How about reinstalling in an entirely different subfolder? Wonder if that would help....

  12. nosab3
    Member
    Posted 4 years ago #

    Can I do that and still keep my data?

  13. vkaryl
    Member
    Posted 4 years ago #

    You should be able to use the same database for an install in a different folder. I haven't done that myself - all you should need to do though I think would be make sure the info in the wp-config.php file points to the original database.

  14. nosab3
    Member
    Posted 4 years ago #

    Thanks for the help...but this still didn't work.

    I just can't seem to figure this one out...

  15. nosab3
    Member
    Posted 4 years ago #

    Note: working with teh same structure as before, I just tried to delete an old post, and the system again crashes and gives mea 500 internal server error.

    So now there are 2 instances when this happens:
    1) trying to change permalink
    2) trying to delete an existing post.

    Anybody got any more ideas?

  16. vkaryl
    Member
    Posted 4 years ago #

    No idea who your host is, but at this point I believe I might contact their support desk and explain the whole thing - ask if they have any ideas....

  17. Malcovious
    Member
    Posted 4 years ago #

    I had the EXACT same problem as you described. I entered an incorrect Permalink structure and was in the vicious cycle. You are correct about the caching of the errant structure. Open PHPmyAdmin and do a search on "permalink" in your WP database. You will find a match under the table: wp_options. Edit that field and you will find your errant structure. Correct the structure, delete .htaccess and then go to your site. Under options -> Permalink, you will see the correct structure listed. Click on update permalink structure and your site is up and running. I too did not want to start over. Thanks for leading me in the right direction.

  18. strawberrie
    Member
    Posted 4 years ago #

    I had that same problem, and I followed the instructions above. The pages are working now but my archive is gone.

  19. strawberrie
    Member
    Posted 4 years ago #

    eep, I take that back, everyone works beautifully... THANK YOU!

  20. Mythia
    Member
    Posted 3 years ago #

    Hello
    Recently I got stuck too from playing with permalinks pattern tags; I searched for help and I found this thread. Seems like the problem hasn't been resolved yet, I shall contribute then. After experimenting many things, I eventually got back my blog, and actually thanks to the tips of "deleting .htaccess and checking mysql databases" I read on this thread.
    Please excuse my awkward use of english as I am not a native speaker.

    This is aimed at newbies and it's sole purpose is debugging. If you still wants nice permalinks, try this first and you'll decide later. Of course, it isn't the perfect and universal solution, it's just MINE.
    So, if you are stuck too with the annoying internal error 500:
    First, don't panic. Else you might screw the whole thing and in the worst case may definitely lose all your database.
    Go on your FTP server, at wordpress root (where the index.php is located). You should find a file named .htaccess, delete it. Now. If it doesnt appear, try to tweak your ftp software options so as to show ALL files.
    Try to reload the main page of your blog. Seems to be back, good. Everything? No. The fun thing begins now.

    The problem comes from your mysql database where some tables were screwed up 'cause you changed the permalinks pattern.
    So go on your admin dashboard, plugins section. Try to avoid at all cost getting on the permalinks page or you'll be stuck with error 500 and you will have to do the first part again. On the lastest versions of wordpress you should have a plugin for database backup. Activate it, then go to the Manage section and you'll see a "backup" tab at the right end. Do a backup of your database, and save the file on your hard disk. It should be gzipped; open the archive with winzip or winrar and extract the file; open it with your favorite text editor, search for the word "permalink", it should bring you on the line
    INSERT INTO wp_options VALUES (34, 0, 'permalink_structure', 'Y', 1, 'the_evil_thing_is_here', 20, 8, '', 1, 'yes') ;
    DELETE THE EVIL THING! You should have then:
    INSERT INTO wp_options VALUES (34, 0, 'permalink_structure', 'Y', 1, '', 20, 8, '', 1, 'yes') ;
    Don't save the file, keep it open and locate the entire wp_option tab contents which should go from
    # Data contents of table wp_options
    to
    # End of data contents of table wp_options
    Highlight the whole thing and copy it (ctrl+c)

    Connect to your mysql database (phpmyadmin). You'll see a list of wp_thing tables where all your blog contents are saved. You'll see an existing wp_options, don't worry. Search around phpmyadmin for the SQL tab where you can execute SQL code, and paste what you've copied earlier. Execute it. The existing wp_options has been overwritten and everything should be back to normal now; rejoice, dude.

    Try to surf around your blog, everything should be back to normal, but...
    As I am french, my language got numerous written accents, and unfortunately, the backup plugin screwed all of them up. But this is another problem, the only solution I've found so far is to edit all your posts and comments, but that's a very long process and needs a lot of patience. If you are french and still want to try the whole trick, feel free to mail me on maho_windforce27 at hotmail.com. I'll be happy to help you out.

    Hope this helps.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags