0 Replies - 652 Views - Last Post: 18 July 2011 - 11:22 AM

#1 teahou   User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 224
  • Joined: 01-April 11

Redirecting .htm pages to new .php pages using .htaccess 301 redirects

Posted 18 July 2011 - 11:22 AM

Hi all. i have just updated all the pages on a site from .htm to .php so I coule use php includes. The site ranks pretty well in google, so I want to use 301 redirects in the .htaccess file. There are around 10 pages that have had their extensions changed. After researching, I have put together this:

RedirectMatch 301 (.*)\.html$ http://www.sitename.com$1.php

and added it as the last line of my .htaccess file. I uploaded this and the new pages about a week ago, but it has not worked because I deleted the old .htm files and the site went away (obviously I had copies of the old files which I reloadd and now the site is back).

I think the issue is either,

1. I need to add a redirect line in the .htaccess file for each page, or
2. I am missing something from the redirect script to make it work.

Obviously I have never done this before, and I have spent about 4 hours researching and trying stuff to no avail. So, I throw myself on your, um, knowledge... Anyway, any suggestions, hints or a good tutorial would be appreciated. thanks.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1