Grow your CSS skills. Land your dream job.

Redirect .php extensions to new page using htaccess

  • # August 12, 2012 at 8:05 pm

    I have a site with a fresh WordPress isntall that has a lot of old .php pages that need to be redirected. (A blank statement that just drops the .php extension won’t work, I need to target specific pages).

    Example:
    /testpage.php needs to go to /test-page-new

    I’ve already set up htaccess 301 redirects for /test.html to /test which work just fine, but the .php extensions aren’t transferring.

    Do I need to use Rewrite and if so how do I implemetnt it with the existing rules generated by WordPress?

    Thanks!

    # August 12, 2012 at 11:04 pm

    You need to make sure that the redirects that are added to your .htaccess file sit before the WordPress RewriteRule’s otherwise that will seek out the PHP files before your redirects do.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".