3 replies
I'm hoping this is stupidly simple for someone else.
Cause it's giving me a headache.

I redesigned one of my sites. I've got a good start with organic search. The old files were .htm. But the new files are .php. (Discovered the wonderful world of php includes, so that's why the change.)

What I want to do is have my hosting server redirect the old .htm pages to the new .php pages. I want this done without alarming the Searchbots and getting sandboxed. My server company sent me to Mod_Rewrite Forums :: Index, but it's still all greek to me, and I'm hoping someone can help me with a model script to drop into my .htaccess file.
#redirects #webpage
  • Profile picture of the author Jeff Simon
    Got the answer from a different forum.

    Here's what I put in the .htaccess file:

    RewriteEngine on
    RewriteBase /
    RewriteRule (.*).htm$ /$1.php
    {{ DiscussionBoard.errors[156666].message }}
    • Profile picture of the author Sean Kelly
      This is the perfect result Jeff because you get to keep your urls as they were before but now your .htm and .html files are processed as .php files.

      You just need to put your PHP code into your .htm and .html files now.
      Be sure to put the .htaccess file in the root (base) folder.

      Sean
      Signature
      http://javadocs.com - Javadocs
      {{ DiscussionBoard.errors[174152].message }}
      • Profile picture of the author Jeff Simon
        Originally Posted by Sean Kelly View Post

        You just need to put your PHP code into your .htm and .html files now.
        Thanks, Sean.
        I'm not sure I understand this one.
        I put no php code into the old .htm pages. When, for instance, the old index.htm file is accessed they get a look at the new index.php file.

        Am I leaving something undone?

        Thanks,
        {{ DiscussionBoard.errors[175293].message }}

Trending Topics