WordPress.org

Ready to get started?Download WordPress

Forums

301 Redirect .php extension to WP pretty links (2 posts)

  1. prosperity66
    Member
    Posted 1 year ago #

    Hi :)

    I recently switched my old fashioned hand coded static site into a nice WordPress one.

    However, I want my .php old files indexed in Google to redirect to my pretty WordPress links (without extension).

    I tried diverse .htaccess codes but it doesn't seem to work.

    Found a default .htaccess including this code in my root folder (where the new site lies)

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

    # END WordPress

    Could this be this one that prevents a 301 redirect from working fine?

    Thanks in advance for the replies.

    Dom.

  2. prosperity66
    Member
    Posted 1 year ago #

    Oops! I forgot to add that both old site and new use folders, example:

    mydomainname.com/folder/page.php

    Sorry...

Topic Closed

This topic has been closed to new replies.

About this Topic