8 Replies Latest reply: May 15, 2012 8:20 AM by revdave RSS

    Setting up Permanent Redirects (and .html go to .php)

    revdave Community Member

      Hi all,


      There is a bigger story but I'll try to keep to just the main issue... I'm a newbie at this so please forgive terms etc.



      GOAL: Setting up permanent redirects from oldsite.com (all html) to newsite.com  (all with the same urls file name but all now = .php)


      So I want to do 2 things:


      1 - redirect everything from old site to new site

      2 - redirect ALL OLD .htm and .html to NEW .php like:


      EX: oldsite.com/folder1/test1.html to  newsite.com/folder1/test1.php


      so in oldsite.com in .htaccess file I added:


      1 -  at bottom...

      redirect 301 / http://www.newsite.com/




      2 - below or above previous both did not work...

      RewriteEngine On

      RewriteRule ^(.*)\.html$ $1.php [L]


      THAT SEEMS TO NOT WORK - it goes to new site but stays on the .html page not the .php version of the same page


      Q: How do I get this working?