The MU forums have moved to WordPress.org

Deleted Htaccess file to try and add new rule, now site is down, please help (14 posts)

  1. allreviews
    Member
    Posted 14 years ago #

    Hello Everyone,
    I have gone through the forums and can not find a solution to our problem. We have many blogs setup under the MU installation, I was playing around and tried to add a new rule to the htaccess so that it would redirect non-www requests. When I opened the htaccess file in the public_html folder it was empty (opened in notepad) so I added a new rule to it for the non-www and uploaded, the blogs would then show 404 page not found errors. So i fond one rule:

    # 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 added this and re-uploaded the file, the blogs are showing but not the layout and design aspect just the text.

    Is there a default htaccess file I can re-upload? Or does the htacess file get written to each time we create a blog? If so, what is the rule that would be written so we could recreate them.

    Any help would be greatly appreciated,
    Kris

  2. allreviews
    Member
    Posted 14 years ago #

    Here is one of the blogs: Brain Training

  3. SteveAtty
    Member
    Posted 14 years ago #

    you mean your .htacess file. Yes there is one in there called htaccess.dist which you could copy over to .htaccess

  4. allreviews
    Member
    Posted 14 years ago #

    Hello Steve,
    Thanks for the quick reply. I copied the htaccess.dist over to my computer then renamed it .htaccess and the site gives me a 500 internal error now. Is this what you meant by copy over?

    Again thanks,
    Kris

  5. SteveAtty
    Member
    Posted 14 years ago #

    so whats the error reported in the error logs?

    Don't you have a backup you could restore it from?

    This is what mine looks like:

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase BASE/
    
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    # END WordPress
  6. allreviews
    Member
    Posted 14 years ago #

    I hope this isnt to long for here, this is the first part of the file:

    [25-Sep-2009 05:46:13] PHP Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/alrev/public_html/wp-content/plugins/adsense.php on line 103
    [25-Sep-2009 05:46:13] PHP Warning: Invalid argument supplied for foreach() in /home/alrev/public_html/wp-content/plugins/adsense.php on line 114
    [25-Sep-2009 07:54:23] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ND wp_5_posts.post_type = 'post' AND (wp_5_posts.post_status = 'publish')) AND p' at line 1 for query SELECT DISTINCT SQL_CALC_FOUND_ROWS wp_5_posts.* FROM wp_5_posts LEFT JOIN wp_5_term_relationships AS trel ON (wp_5_posts.ID = trel.object_id) LEFT JOIN wp_5_term_taxonomy AS ttax ON ( ( ttax.taxonomy = 'category' OR ttax.taxonomy = 'post_tag' ) AND trel.term_taxonomy_id = ttax.term_taxonomy_id) LEFT JOIN wp_5_terms AS tter ON (ttax.term_id = tter.term_id) LEFT JOIN wp_users AS u ON (wp_5_posts.post_author = u.ID) WHERE 1=1 AND ( wp_5_posts.post_type = 'post' AND (wp_5_posts.post_status = 'publish' OR ((tter.name LIKE '%german%')) OR ((tter.slug LIKE '%german%')) OR ((ttax.description LIKE '%german%')) )ND wp_5_posts.post_type = 'post' AND (wp_5_posts.post_status = 'publish')) AND post_type != 'revision' ORDER BY wp_5_posts.post_date DESC LIMIT 0, 5 made by require, require_once, include, get_sidebar, locate_template, load_template, require_once, dynamic_sidebar, call_user_func_array, WP_Widget->display_callback, WP_Widget_Recent_Posts->widget, WP_Query->WP_Query, WP_Query->query, WP_Query->get_posts

  7. allreviews
    Member
    Posted 14 years ago #

    Steve,
    Thanks for all the help. I did try your htaccess file and it gives me a 500 internal error. I also did not backup the site before deleting the .htacess file.

  8. SteveAtty
    Member
    Posted 14 years ago #

    you need the error from the apache error log, not from the php error log. As 500 is a fatal server error you should find it quite eadily.

  9. allreviews
    Member
    Posted 14 years ago #

    Yes, but the current error isn't a server 500 error, it is only server 500 when i try the .htaccess from your site. Do you think it would be better to use your file and then check the sever 500 error via the Apache log?

    Again thanks,
    Kris.

  10. SteveAtty
    Member
    Posted 14 years ago #

    You said the htaccess dist gave a 500 error as well.

    So you've got to work out why they're wrong.

  11. allreviews
    Member
    Posted 14 years ago #

    Steve, I am having our programmer have a look. I have asked him to use your instructions and I will post our solution just in case anyone else needs it. Thank you for your help and enjoy what is left of the weekend.
    Kris

  12. andrea_r
    Moderator
    Posted 14 years ago #

    "RewriteBase BASE/"

    This line has to be changed as well to RewriteBase /

  13. SteveAtty
    Member
    Posted 14 years ago #

    Hmm, I wonder how I managed to do that when I was chopping out my WP Supercache line and a few other lines out. I guess I'd left something in the paste buffer :(

  14. mamunitiw
    Member
    Posted 14 years ago #

    Same problem happened to me. Please give me a solution. Just uploaded a new htaccess file after this the site is down. 404 error.

About this Topic

  • Started 14 years ago by allreviews
  • Latest reply from mamunitiw