• Resolved bepresents

    (@bepresents)


    Here’s a WordPress Quiz Question for the smartest!

    I’m migrating a site to WordPress that has very extensive SEO work on it so we want to keep all the old pages.

    If I make page2.php as a duplicate of WordPress’s index.php what code can I put into it, or the theme files, that will make page2.php ONLY load WordPress page id=123?

    Thanks in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • I am a newbie – definitely not one of the smartest. And I am not sure I really understand you question.

    But – if you are wanting your site to open with your page id=123 I think I tell you how to do that. I changed the page my site opens with this way.

    Use your phpMyAdmin – in your database go into wp-options. Find the option name – “page-on-front”. Simply edit this record and change the option value to your “123” – but remember what is there so you can put it back if this doesn’t work – save it and it should work – it worked for me.

    Thread Starter bepresents

    (@bepresents)

    No not the default landing page, but a brand new PHP page.

    ie:

    /index.php : loads WP in root folder

    /page2.php : This is a copy of the code in “/index.php” but is named differently. When I try and run this, instead of loading:

    mysite.com/page2.php

    it loads that for a second and then redirects to

    mysite.com

    I want to know if there is a way to have a bunch of “copies” of WordPress’s index.php, renamed differently, each loading a different page from WordPress statically.

    I also thought about doing it with .htaccess something like :

    RewriteEngine On
    RewriteRule ^(.*/)?page2.php https://www.mysite.com/index.php?page_id=123 [L]

    But I have yet to get over the .htaccess learning curve and get this to work!

    Thanks in advance for any answers!!

    I’m migrating a site to WordPress that has very extensive SEO work on it so we want to keep all the old pages.

    Use 301 redirects. It’s a webmaster standard because it’s easy and preserves your backlinks, SEO, and search engine rankings.

    Thread Starter bepresents

    (@bepresents)

    That won’t work because 301 Redirects don’t preserve the URLS and our SEO specialist says he doesn’t like Redirect only RewriteRule or using a real file.

    If I do:

    Redirect 301 /page2.php /index.php?page_id=123

    Then the browser is redirected to /index.php?page_id=123, the URL’s are different and the search engines get 2 URLs for 1 page.

    And it’s hard to use .htaccess Redirect with WordPress since WordPress is so heavily reliant on .htaccess code for making permalinks, it bypasses most of the permalinking. Which makes using RewriteRule hard to use too.

    In your page editor in the WordPress Admin section, set the page to use a custom page template (aka your page2.php). Doing it that way means that you don’t have to try to write redirects for WordPress, which by design handles URLs differently than a normal server file system.

    For more information, see Pages.

    Thread Starter bepresents

    (@bepresents)

    I did get this to work, with .htaccess code like this:

    RewriteEngine On
    RewriteRule ^(.*/)?page2.php index.php?page_id=1259 [L]

    You do not need to preserve the URLs to maintain your backlinks, SEO, and rankings with 301 redirects, and it’s odd that your SEO specialist is telling you otherwise. I converted a static html site to WordPress and I used hundreds of 301 redirects, and Google updated the new URLs without problem and my rankings were unaffected. WordPress does not have a problem with 301 redirects as long as you keep them out of the WordPress section of the .htaccess code.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Can someone help with simple question? Please please!’ is closed to new replies.