Webpage redirects

by 3 replies
4
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.
#programming #redirects #webpage
  • Banned
    [DELETED]
  • Got the answer from a different forum.

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

    RewriteEngine on
    RewriteBase /
    RewriteRule (.*).htm$ /$1.php
    • [1] reply
    • 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
      • [1] reply

Next Topics on Trending Feed