|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Search Engine Optimization Forum SEO is much easier with help from peers and experts! The WebProWorld SEO forum is for the discussion and exploration of various search engine optimization topics. Any non (engine) specific SEO or SEM topics should go here. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I plan to extend my new website as I go along and just start off with a few pages... On some pages I probably will be ok to use simple HTML page, where on some other pages I will use PHP to interact with a database. What is the best advice for me: Do I save all files with .php to make sure I can use the extended functionalilty PHP offers (if needed) or is there an other way to stay more flexible?
Kurt |
|
|||
|
I prefer to have all extensions with php, regardless of whether the pages have php or just plain html, that way, if you ever need to include php in a page, you're all set
__________________
----Don't Call Me Brian---- |
|
|||
|
If you're going to re-do the whole thing in PHP, then it might be worth including a few lines of code ready for if you need them.
I tend to bring in a lot of files through PHP includes and always put in "blank" includes from the start so I don't need to backtrack later if I need to. Most particularly I include in the <head> * configuration settings * ie css-hacks * pointer to my js scripts In the <html> I always include * copyright-footer These are elements you'll find you want on every page and it's far better having them available from the start in case you want to add stuff later! Cheers, Niggles
__________________
------------------------------------------------- World Music World - bringing the World's Folk Music Cultures Together http://www.worldmusicworld.com/ ------------------------------------------------- |
|
||||
|
Kurt, sounds like you are going to be developing the php.
If so, why not use a content management system? Reg
__________________
http://DotCom-Productions.com Website Management http://0Grief.com Budget PHP/MySQL hosting |
|
||||
|
I am interested in wige´s solution, even though I agree and muchly do as hostbrain. Further details wige? Do you handle that through the htaccess alone, or something else?
Thanks. |
|
|||
|
Why not to develop XML with XSLT and CSS formatting? I did that for my mobile content publishing sytem http://veikoh.freehostia.com/weeblog/frameset.html for IE, Welcome to mobile content publishing system for Opera.
Was interesting to develop, spent two weeks but google loves it. The project is currently in hold until I found extra £500 to finish it as proper mobile content publishing system. There is still also some bugs there.
__________________
Submit your site free to Unknown Web Directory eCommerce and Internet Marketing articles in my blog |
|
|||
|
Quote:
IN the root directory, put your htaccess file and put the following code Quote:
__________________
----Don't Call Me Brian---- |
|
||||
|
We use .php as we're on a Linux server and make good use of PHP includes. I realise this can be done with SHTML, but there's no real advantage to us changing our regular practice for that, so it's .php for us
|
|
||||
|
hostBrain above provided the best solution.
__________________
"Being an expert isn't telling other people what you know. It's understanding what questions to ask, and flexibly applying your knowledge to the specific situation at hand. Being an expert means providing sensible, highly contextual direction." Jeff Atwood SEO Workers - Search Engine Optimization Consulting Company | SEO Analysis Tool | Webnauts Net SEO |
|
|||
|
Just for newbies as me:
Having installed Apache web server on my laptop (just for testing) I have a configuration file called "httpd". Is this what you mean by "htaccess"? If yes, why the different name? Then if I include the following line "AddType application/x-httpd-php .php .html " in this file: I save my files at .html (or .htm when inserting "AddType application/x-httpd-php .php .htm") and they will show as such, but still process php? Did I get this right? If I understood this correctly: Is it normal practice that you can access this file to make changes with your hosting company? With my old hosting company I am almost sure there was no way for me to alter things like this (I am just in the process of evaluating a new hosting provider)... Kurt |
|
||||
|
.htaccess is a configuration file that you create and enter in the folder you want the directives applied to. The httpd configuration file is the central configuration file for Apache. If you own the server, you can make the changes in the httpd file. However if you have shared hosting you need to make the changes in an .htaccess file located in your root directory. The directives will carry to all subdirectories as well.
As far as the directives, other than the one already mentioned, I use Header unset X-Powered-By which removes the identifier telling the user that the page uses PHP.
__________________
The best way to learn anything, is to question everything. |
|
||||
|
Great, thank you (both hostbrain and wige) for the further reply!
|
|
|||
|
So, when I go live I will create a .htaccess file (just including the mentioned entry or do I need to include other information?), which I put in root directory (where all web pages of site will be placed)? Does it cascade down (be applied to all subfolders)?
Kurt |
|
||||
|
btw, don´t panic when you upload the file via ftp in root, if it "vanishes" from the file list when you refresh (the htaccess is a hidden file, at least in all servers I´ve known).
|
|
|||
|
Still have problems to understand:
I create a file (in my text editor) and place the following only as content "AddType application/x-httpd-php .php .html ". Then I save the file as .htaccess (is this actually the file extension or is the name htaccess with a dot and sth else behind)??? Got the upload bit (at least sth)... Kurt - the one with the small brain |
|
||||
|
The name of the file is
.htaccess (with a dot in front of the h) and may in addition to the directives mentioned above include configuration paths like php_value include_path ".:/usr/local/lib/php: etc : etc. Block bad bots like this: (# indicates comments in the file). RewriteEngine on #Only include this line once to enable the rewriting engine #These lines block agents commonly used to harvest URLs and email addresses. #One of the uses of such agents is to gather URLs for subseqent referral spamming #by a large number of hosts. Thus, preventing their access may, by itself, decrease #the amount of referral spam you receive. RewriteCond %{HTTP_USER_AGENT} ^Microsoft\ URL\ Control.*$ [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^Mozilla/4\.0\ .*Win\ 9x\ 4\.90.*$ [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^.*Indy\ Library.*$ [NC,OR] #These lines block bots that use your bandwidth for their own commercial reasons. RewriteCond %{HTTP_USER_AGENT} ^abot.*$ [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^aipbot.*$ [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^Linkwalker$ [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^.*nameprotect.*$ [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^.*TurnitinBot.*$ [NC,OR] Deny unique IP's deny from ***.***.***.*** Deny IP regions deny from 192.168.112.0/24 Explained at the DNSStuff site in the lower left corner in the field named CDIR/Netmask Apache Tutorial: .htaccess files Related link: Apache HTTP server project. (Note: the "Get involved menu" with sub menus, "Mailing list", "Bug Report" and "Developer Info"). P.S. deny from 0.0.0.0/1 Will deny the IP range 0.0.0.0 through 127.255.255.255 [2147483648 IPs] from accessing your site. #For serious offenders or spammers who send referral spam directed to several different #domains, I block access by IP address. Listed here are the worst offenders. This method #may be more conservative than some people want to be; if so, just leave this part out of #your .htaccess file. <Files 403.shtml> order allow,deny allow from all </Files> #examples deny from ........ (Long list excluded) You may use this technique to set up an informal extranet. (An extranet is a network where only your current customers have access.) Join the DNSStuff forum if you want to be an expert on this.
__________________
Mini Network:: Financial information at your fingertips Learn object oriented programming where it started I will use a search engine before I ask dumb questions. Last edited by kgun; 10-15-2007 at 09:44 AM. |
|
|||
|
But to start off with, it would be ok to just have one line as 'AddType application/x-httpd-php .php .html ' in the .htaccess file? Do not feel to confident and would like to extend slowly (when I get ok through documentation)...
Kurt |
|
||||
|
Yes, that one line is fine, although the .php portion is probably not needed (already set elsewhere). Make sure you upload this file to your document root, this is the top level folder, where your home page is.
__________________
The best way to learn anything, is to question everything. |
|
||||
|
I wanted to mention that I am already using this for a new site, and works wonderfully!!! Thank you guys!!! :-*
|
|
||||
|
Quote:
But if you are on a shared hoster you do not always have access to that file. In addition, .htaccess is on a lower level than php.ini and as such probably more secure.
__________________
Mini Network:: Financial information at your fingertips Learn object oriented programming where it started I will use a search engine before I ask dumb questions. |
|
||||
|
Actually I meant more that instead of using
AddType application/x-httpd-php .php .html he should use AddType application/x-httpd-php .html in case .php is already set, possibly with a different type for a different php preprocessor. He is looking for simple after all, so keep the terms and settings as minimal as possible. Also, if the line doesn't work, you can rename the file to .php to test the original configuration without an override for troubleshooting.
__________________
The best way to learn anything, is to question everything. |
|
||||
|
You are clever.
__________________
Mini Network:: Financial information at your fingertips Learn object oriented programming where it started I will use a search engine before I ask dumb questions. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 1 site with 30 pages OR 3 sites with 10 pages? | fctoma | Marketing Strategies Discussion Forum | 7 | 05-18-2007 12:14 AM |
| Best Option: Landing Pages or Sub Domain Pages??? | peterson | Search Engine Optimization Forum | 2 | 07-08-2006 02:29 PM |
| Content on popup pages vs. regular pages | dartman | Content Discussion Forum | 16 | 06-02-2006 02:02 AM |
| Keeping old pages, not visiting new pages | climaxphoto | Yahoo! Discussion Forum | 3 | 08-24-2004 02:26 AM |
| Keeping old pages, not visiting new pages | climaxphoto | Yahoo! Discussion Forum | 0 | 08-19-2004 06:50 PM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2010 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |