![]() | | ||||||||
| | #1 |
| Warrior Member War Room Member Join Date: Jun 2008 Location: Sacramento, CA, USA.
Posts: 7
Thanks: 3
Thanked 0 Times in 0 Posts
|
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. |
| | |
| | #2 |
| Warrior Member War Room Member Join Date: Jun 2008 Location: Sacramento, CA, USA.
Posts: 7
Thanks: 3
Thanked 0 Times in 0 Posts
|
Got the answer from a different forum. Here's what I put in the .htaccess file: RewriteEngine on RewriteBase / RewriteRule (.*).htm$ /$1.php |
| | |
| | #3 |
| Advanced Warrior War Room Member Join Date: Oct 2006 Location: Ireland
Posts: 750
Thanks: 5
Thanked 34 Times in 24 Posts
|
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 |
| http://www.ViralPDF.com - The #1 PDF Rebrander since 2002 http://www.PdfPrinterPro.com - Create PDFs with Audio, Video and Flash inside http://www.PdfLocker.com - Lock & Encrypt your PDFs quickly & easily | |
| | |
| | #4 | |
| Warrior Member War Room Member Join Date: Jun 2008 Location: Sacramento, CA, USA.
Posts: 7
Thanks: 3
Thanked 0 Times in 0 Posts
| Quote:
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, | |
| | |
![]() |
|
| Tags |
| redirects, webpage |
| Thread Tools | |
| |
![]() |