![]() | | ||||||||
| | #1 |
| copy and paste geek War Room Member Join Date: Jan 2005 Location: Calgary
Posts: 1,390
Thanks: 68
Thanked 168 Times in 140 Posts
|
I have a site that has 35 pages with more coming up. Always thought I would just switch over to php includes when the pages got to be too many to change the navigation easily. Thought the time had come and started looking around to find out how to do that and then find out that I need a .php extension instead of .html on all the pages. Nearly all of these pages have back links and I really hate to clog up the files with that many redirects. Has anyone else gone through this and can suggest another way to make the change over? And another related dumbie question, maybe I should start all sites with .php file extensions, even if I'm not using any php to begin with? I don't suppose it hurts anything to just use html for a .php page? The things that can go wrong (!) ../lloyd |
|
There are 10 types of people, those that understand binary and those that don't. The KimW WSO | |
| | |
| | #2 |
| People Know Me War Room Member Join Date: Sep 2006 Location: Virginia Beach
Posts: 667
Thanks: 21
Thanked 129 Times in 111 Posts
|
Try putting this in .htaccess PHP Code: |
| | |
| | #3 |
| Tim The Toolman Brechbill War Room Member Join Date: Aug 2005 Location: Omaha, Nebraska
Posts: 58
Thanks: 5
Thanked 2 Times in 2 Posts
|
Add this to your .htaccess file in your home directory # The following will make php files will work with a htm(l) extension AddType application/x-httpd-php .html .htm If you don't have a .htaccess file, create one and include the following: Options +FollowSymLinks RewriteEngine on RewriteBase / # The following will make php files will work with a htm(l) extension AddType application/x-httpd-php .html .htm <Files php.ini> order allow,deny deny from all </Files> |
| | |
| | |
| | #4 |
| HyperActive Warrior War Room Member Join Date: Nov 2008
Posts: 121
Thanks: 3
Thanked 16 Times in 14 Posts
|
Hey Lloyd, had a bit of a poke around the old interweb for you and found this - How to Redirect index.html to index.php | CSS-Tricks Not sure if it's exactly what you're looking for, but it might help you get there. Take it easy! |
| | |
| | #5 |
| The Dedicated Helper Join Date: Dec 2009 Location: Norway
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
|
Hi Loyd. I found something that might help you: This technique will only work if your Apache server has PHP enabled and .htaccess enabled. Do a search in google for "how to test php support in apache http server" to find out how to test this. In the root directory of your html files create a file named .htaccess. The file may already be present. Open the file in your favorite editor and add the following lines: addtype application/x-httpd-php .html addtype application/x-httpd-php .htm Done! Warmest regards, Victor A. Roestad |
| | |
| | |
| | #6 |
| copy and paste geek War Room Member Join Date: Jan 2005 Location: Calgary
Posts: 1,390
Thanks: 68
Thanked 168 Times in 140 Posts
|
Thanks everyone. A lot of this sounds really good. I can see that I have to start way back with a php template and redo the site a bit and it is going to be Tuesday before I can even start working on it. (Day job for the next 3 days.) Turns out I had just assumed I could add a bit of php to an html site but from a bit of reading today that doesn't seem true anymore. Does anyone happen to know if I loose page rank with these redirects? If so I might just tough it out and leave it up as html, maybe start another site for new material. |
|
There are 10 types of people, those that understand binary and those that don't. The KimW WSO | |
| | |
![]() |
|
| Tags |
| html, includes, pages, php, work |
| Thread Tools | |
| |
![]() |