Click to See Complete Forum and Search --> : HTML and php parsing
ADancingDemon
01-10-2009, 06:23 PM
OK, I've been working out how to do an external naviation bar with php.
I want to keep my .html files as html files, though, not php.
So I gather I need to edit the .htaccess file to do this. But, when I read up on this they talk about Apache and Linux. I can't find anywhere that tells me what a normal web developer should do. I mean, I use Windows and all that stuff [and can rename/etc the file fine]
I don't get the connection between the apache/unix stuff and the .htaccess stuff. Can I just create/change the .htaccess file like instructions say and not worry about it? Or am I supposed to be doing something else?
Incidentally, what I am trying to do right now isn't working but this part has me confused as heck. I might be revealing some of my newbieness here but if someone could toss me advice I'd be ever so thankful.
Thank you!
NogDog
01-11-2009, 10:15 AM
Apache web server can be run on Windows, Linux, UNIX, and probably a handful of other OS's.
.htaccess files only come into play if (a) you are accessing your web ages via an Apache web server, and (b) your Apache configuration allows the use of local .htaccess files (and possibly also the specific commands you want to use within that .htaccess file).
If you are talking about testing locally on your Windows PC, consider installing WAMP (http://www.wampserver.com/) or XAMPP (http://www.apachefriends.org/en/xampp-windows.html) on your PC in order to install Apache and PHP.
ADancingDemon
01-11-2009, 10:53 AM
I was actually trying to just make a webpage do this on the [live] internet... I don't know anything about Apache [I am sure it shows]. But all the sites tell me to change the .htaccess file if I want the php pages to still retain the .html endings when viewed on the net. Is there another way to do that? Am I barking up the wrong tree? Thank you for your post & help.
http://www.webdeveloper.com/forum/showthread.php?t=199313
ADancingDemon
01-11-2009, 02:03 PM
Apache web server can be run on Windows, Linux, UNIX, and probably a handful of other OS's.
.htaccess files only come into play if (a) you are accessing your web ages via an Apache web server, and (b) your Apache configuration allows the use of local .htaccess files (and possibly also the specific commands you want to use within that .htaccess file).
If you are talking about testing locally on your Windows PC, consider installing WAMP (http://www.wampserver.com/) or XAMPP (http://www.apachefriends.org/en/xampp-windows.html) on your PC in order to install Apache and PHP.
So I need to install Apache to make enable me to properly edit .htaccess and get my .html pages to still stay as .html pages and not php? There is no other way?
Fang, thank you for the link, I am digesting that. From what that pages says it's kind of pointless to do what I am doing. I guess I just don't get it - what's the point of php if you can't keep your .html pages the way they are? It is worth all this fuss?
felgall
01-11-2009, 02:48 PM
Some other web servers would have their own way of changing how files with particular extensions get parsed. Most PHP runs on as Apache as the web server so that would be the server you'd most commonly want to make that change for when using PHP.
ADancingDemon
01-11-2009, 02:53 PM
OK... so in order to make that change, I to need to get Apache? I had thought it was as simple as creating/changing a .htaccess file in notepad and sticking it up there with the right stuff inside it.
Does it matter that I use Godaddy? I assume they use Apache?
Thank you for dealing with the noob questions. I have all this stuff in my head I am trying to align and make sense of!
Afaik you can create a htaccess file for a Godaddy account.
The extension used is irrelevant; Apache can be configured to run any extension with any server side language.
Hiding the extension makes for a cleaner URL.
ADancingDemon
01-12-2009, 02:54 PM
Well I have sorted out that I have a Windows shared hosting account with GoDaddy, and apparently the one system I have IIS6 doesn't offer php support, only IIS 7 does. And there's no way to get IIS 7 except to basically delet my account and open it - or, change it to a Linux account. But then I would need to run Linux to get all that stuff to work, right?
Fang - thank you - this is helping me a great deal. I'm just not sure that my server is able to do what I want - seems a common GoDaddy complaint. Maybe there are work arounds but I don't know.
All Godaddy accounts appear to support PHP (http://www.godaddy.com/gdshop/hosting/shared.asp?isc=bf20host)
Email Godaddy, they should be able to help you.
ADancingDemon
01-13-2009, 10:10 AM
I wrote them and this is what they said:
Thank you for contacting Online Support. Windows IIS 7 shared hosting accounts run PHP 5, allowing you to install a variety of PHP 5 quick-install applications and integrate PHP 5 scripts and code into your site. PHP 5 technical support is available for accounts running IIS 7.
PHP support for IIS 6 Windows shared hosting accounts has been deprecated. PHP runs in Safe Mode on IIS 6 shared hosting servers, and we no longer offer PHP technical support for IIS 6 shared hosting accounts which is what your servers appears to be running on. Unfortunately you cannot update the account to IIS 7 and would have to cancel the account with the steps below or change it to a Linux account where it would be supported.
Canceling your hosting account will delete all of your Web site files that you have stored on our servers. Be sure that you have copies of any files you want to keep before you cancel your account.
[Instructions on how to cancel my account]
If you would like to switch to Linux please use the steps below.
To switch the operating system of your hosting account, please use the following instructions:
• Select 'Hosting' under the 'My Products' section.
• Click on the name of the hosting account whose operating system you want to change.
• In the 'Account Details' section on the right, click 'Upgrade/Downgrade Hosting Account'.
• Select a new hosting plan (ASP = Windows; PHP or CGI = Linux).
• Click 'Continue'.
• If your new hosting plan is an upgrade from your existing plan, proceed through the purchase process. Otherwise, click 'Save Changes'.
This change may take 24-72 hours to complete. You will receive an email message when we complete your upgrade. NOTE: If your Web site contains certain advanced features, such as ASP, ASP.NET, CGI, or PHP applications and you select a hosting plan that does not support those advanced features, your Web site may no longer function properly after the plan change. Please make sure your Web site does not contain advanced features BEFORE moving to a plan that may not support them or be prepared to modify your Web content accordingly. If you created databases that are incompatible with the new operating system, you must delete them before proceeding. Data existing in compatible databases will be preserved.
All new Windows accounts with GoDaddy get IIS7 but if you're a current account with an older set up [I have IIS6 and have had this site for years] then you're screwed basically. My understanding from this [which might be wrong] is that php isn't as likely to work with II6. Considering I have had no luck with .htaccess editing [and I think I've tried every code I found on the net] I am wagering that is true.
Switching to Linux is apparently an option and this is a simple question but, I don't have Linux, I have Windows on my machine. I don't need to get Linux, do I? If I switch to Linux would running something like Apache be what I need to do? How steep is the learning curve with Apache? It's software, right? :o
htaccess should work in safe mode. It is possible to override the htaccess file in the server configuration file (normally you won't be allowed to change this file).
Have you tried this in the .htaccess file?AddHandler application/x-httpd-php .php .html .htm
You don't have to use Linux. I run Apache (the server) on XP or Vista for testing purposes.
If you want to test locally, get XAMPP (http://www.apachefriends.org/en/xampp-windows.html), installation and use is quite simple. Very little knowledge required.
tracknut
01-13-2009, 11:21 AM
Switching to Linux is apparently an option and this is a simple question but, I don't have Linux, I have Windows on my machine. I don't need to get Linux, do I? If I switch to Linux would running something like Apache be what I need to do? How steep is the learning curve with Apache? It's software, right? :o
To answer this one, having Linux on your web server has no influence on what you have on your local PC. So you could switch the server (I should say have GoDaddy switch the server) to Linux w/ Apache, with no impact to your PC. And you don't have to learn Linux, you just need to make one file. :)
The only other thing to check, if you do plan on switching the OS, is whether you're using other server-side components that might only be available on their Windows server. I'm not sure what those might be, but for example their 3rd-party application list isn't the same on both OS's.
Dave