|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Using HTACCESS to parse HTML as PHP
Hi,
I want to design a site using PHP. It is heared that Search engines won't index dynamic web pages. My site is hosted in Apache Webserver. So how can i use HTML extension for my php script so that search engines can index the pages thinking of it as normal HTML file. Can anyone help? Yujin Boby |
|
#2
|
|||
|
|||
|
in my experience search engines have had no problem indexing php pages
try altavista for example, search for this url:.php What they don't like is pages where there is a ?name=value string attached to the url |
|
#3
|
|||
|
|||
|
Tnx
Tnank you bumperbox for pointing out se hav no pblm with PHP pages. I just heared se won't index dynamic pages, may ones generated from data base.
Thank you for the respons. Last edited by vu3prx : September 15th, 2001 at 09:47 PM. |
|
#4
|
|||
|
|||
|
As far as I know most indexing engines will index a dynamic site just fine. It follows links from your index page and spiders your entire site. If it's not indexing a certain page, it may not be linked to anything. It indexes my site and all my extensions are PHP. Anyway, here is instructions on doing what you wanted. Just add this to your .htaccess or httpd.conf:
AddType application/x-httpd-php .htm .html Make sure you take any other AddType and AddHandler out for these extensions that might interfere. |
|
#5
|
|||
|
|||
|
It Fails to work
Hi lectos,
Tnanks for your suggestions. Nice to know search engines have no pblm with php pages. I have three sites done using php and i was worried abt this as i designed some of the sites to get listed in SE. I don't have access to httpd.conf and i can use .htaccess. I tryed .htaccess with AddType application/x-httpd-php .html But i am getting server error. So i delete the .htaccess file. I can't see the .htaccess file in cute ftp. So i need to login using ftp.exe (command line) inorder to delete .htaccess Is it require any more change in .htaccess Thanks, Boby |
|
#6
|
|||
|
|||
|
.htaccess is a hidden file. You have to set cuteftp to show remote hidden files or make it send a "-la" with the directory list commands. It's an option somewhere. It's probably conflicting with another command in the httpd.conf. I wouldn't worry about it and just name all your files .php or whatever like usual.
|
|
#7
|
||||
|
||||
|
I do not understand why you want to force html files parsing as php.
I think that you can use the php extensions for parsing those kind of files only. In the future you could have the needs to create some html pages that do not contain php code. Doing so (adding the AddType), your web server will parse the html file, wasting time for nothing. Why consume time for adding that kind of directive? As said by other people no problems with SE, so why add this directive? Maybe you have special reasons for changing .php to .html that I do not know (mybe for compatibility with older site versions?). If I were you I would not put any AddType directive into your .htaccess file, but simple I will publish my pages with php extension. As a suggestion, SE could prefer to see /articles/15/ instead of /articles.php?id=15 and this could be done with Apache into .htaccess (There some limitations and notes about the use, If interested about the argument do a search for "internal redirection" and/or "mod_rewrite" module in this forum or consult apache docs for more infos) Just my point of view. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Using HTACCESS to parse HTML as PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|