WordPress.org

Ready to get started?Download WordPress

Forums

Migrated Servers, Now Static Front Page getting 500 Error (6 posts)

  1. jbrewlet
    Member
    Posted 1 year ago #

    I've read a few other instances of people having this problem. All of my pages load except the static front page. If I change the static front to any other page, they load also. My database and Dashboard all work great.

    Home: http://makecollab.com
    Blog: http://makecollab.com/factory

    There is only an index.php file in my root, which has the following:

    <?php
    /**
     * Front to the WordPress application. This file doesn't do anything, but loads
     * wp-blog-header.php which does and tells WordPress to load the theme.
     *
     * @package WordPress
     */
    
    /**
     * Tells WordPress to load the WordPress theme and output it.
     *
     * @var bool
     */
    define('WP_USE_THEMES', true);
    
    /** Loads the WordPress Environment and Template */
    require('./wp-blog-header.php');

    I feel its a problem with my htaccess file, I have it set to the basic:

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

    Permissions on the htaccess file are 644.

    I have also checked wp-config.php and tried both with and without define('RELOCATE',true);

    I have checked the database manually and the URL is correct, same as in dashboard settings.

    Sigh, I'm not sure what else to try here. Thanks for any help.

  2. s_ha_dum
    Member
    Posted 1 year ago #

    I have checked the database manually and the URL is correct, same as in dashboard settings.

    There should be two URLs in the database that you need to change, not one, but I'm not sure that is the problem.

    Have you reset your permalinks since the move? wp-admin->Settings->Permalinks?

  3. jbrewlet
    Member
    Posted 1 year ago #

    Thanks for the suggestion. I had not reset permalinks. I tried to reset them but it proved no different results when loading the static page.

    I also checked both URL for SiteURL and Home and they are correct.

  4. jbrewlet
    Member
    Posted 1 year ago #

    I have narrowed down my problems to residing within a server problem related to a Page Template. My static page works when I switch to my Default Template. My static home template I modified from the Default and for some reason with this new server it gives me a 500 Error. Below is the code of my Default Page Template for reference:

    <?php get_header(); ?>
      <div id="bd" class="yui-navset">
    
        <div id="yui-main">
    		<div class="yui-b" >
    			<div class="yui-g">
    
    <!-- item -->
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="item entry" id="post-<?php the_ID(); ?>">
    				 <div class="itemhead">
    				          <h3><?php the_title(); ?></h3>
    				 </div>
    				 <div class="storycontent">
    
    				<?php the_content(); ?>
    
    				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    			</div>
    		</div>
    	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    <!-- end item -->
    
    		<?php endwhile; ?>
    	<?php endif; ?>
    <!-- end content -->
    <!-- 2nd sidebar -->
    
    <!-- end 2nd sidebar -->
    			</div>
    		</div>
    	</div>
    	<div class="yui-b" id="secondary">
    
    <?php get_sidebar(); ?>
    
    	</div>
      </div>
    <?php get_footer(); ?>

    Here is my No-Sidebar or Static Home Template:

    <head>
    <meta name="google-site-verification" content="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
    <script type="text/javascript">
    
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-xxxxxxxxx-x']);
      _gaq.push(['_trackPageview']);
    
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    
    </script>
    </head>
    
    <?php\
    /*\
    Template Name: No Sidebar
    /*\
    ?>
    <center>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div id="what">
    
    <?php the_content(); ?>
    <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    <?php endwhile; else: ?>
    
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>
    </center>

    I'm really not knowledgeable enough to know what is wrong here with the PHP code or relation to my server setup that's causing it to not even throw a 404. Literally everything is else on my site is working perfectly and faster since the migration.

    I would really appreciate any help.

  5. s_ha_dum
    Member
    Posted 1 year ago #

    That second block of PHP is pretty badly malformed and it isn't even a complete web page. This:

    <?php\
    /*\
    Template Name: No Sidebar
    /*\
    ?>

    ... should be at the top and you should not have those odd backslashes. Those are probably causing problems when the PHP is executed.

    <?php
    /*
    Template Name: No Sidebar
    /*
    ?>

    And you need <?php get_header(); ?> and <?php get_footer(); ?> as in the default page template, as you called it, in order for WordPress to construct a complete web page.

    That whole <head> block really has no business being in a template file like this at all. It should be in header.php which is loaded by the get_header() function.

  6. jbrewlet
    Member
    Posted 1 year ago #

    Good finds. I'm getting somewhere. Now no 500 Error just a blank white page.

    Here's where I'm at:

    <?php
    /*
    Template Name: No Sidebar
    /*
    ?>
    <!-- item -->
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    <div id="what">
    <?php the_content('\
    \pard\pardeftab720\sl360\sa360\ql\qnatural
    \cf2 Read the rest of this page \'bb</p>'); ?>
    <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    <?php endwhile; else: ?>
    </div>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>
    </div>

    The entire intent of this page is to load up some simple HTML that serves as a splash. See a cached version.
    Thus I don't want the blog header or footer loaded in.

Topic Closed

This topic has been closed to new replies.

About this Topic