Okay I'm quite confused here, I want to convert one of ym sites to php. I hear suggestions everywhere where they say just change the html extention to php. Is this correct? I use godaddy and a problem is it doesn't parse php on html pages even if you tell it to in the .htaccess. (I'm a complete newbie when it comes to this, hell I don't even know what parse means, I just know it doesn't and I know the result of it.)
Why do you want to convert it to .php? I don't know what you mean by they don't parse (I don't know what the word parse means) php on html pages? You mean you want to write .php on .html pages?? I haven't tried but I don't think it works. Just simply change your extension .html to .php and it should work? :S
Changing the extension will make the files technically php, but nothing will really change (except all your links). Parsing is what the server does behind the scenes to separate the HTML code from the PHP code and process/run the PHP code. I used to use godaddy a few years back and I thought it would parse pages regardless of extension. How are you testing if it is parsing the PHP? Did you try adding the following to your .htaccess file? RemoveHandler .html .htm AddType application/x-httpd-php .html .htm Code (markup):
Yes I've tried, godaddy does not allow adding those lines to .htaccess. If I add those lines or variations of them to htaccess then the site shuts down and prompts the viewer to download a file. Godaddy wont allow you to parse .php on html pages but if the page is php then it will.
They may be using php5. Try: <code>RemoveHandler .html .htm AddType application/x-httpd-php5 .html .htm</code>
No it doesn't matter, godaddy will not allow that command in htaccess, there is no way to by pass other then to make page into php.
Why do you want to change the extensions of your site's filenames to ".php" ? Do you have a reason for that? Are you planning to add some dynamic scripting?
Ai is it even worth mentioning once more... for the last time, I am hosted on Godaddy. As such if I want to parse php code on an html page the conventional way would be to add some text to an .htaccess file, HOWEVER*** I can not do this as godaddy doesn't allow it, thats that. No by passing it. However if the page is in .php then the php scripts will run on the page. LOL
im very confused on what you want. do you want php scripts in your html files? then its not possible do you want html in php files? and just want to use them as normal html. Why? is there any reason behind this? I dont see any reason to rename html files to php just to use them as normal html files. php doesnt make the site better, or rank better in search results. are you planning to add some functionality to your site, such member registration? guestbook?
1. ur name of files should be php 2. in .htaccess tell that donot show php as file extension show html as file extention This is solution for what u r asking Regards Alex
and that way i find renaming files to php and then tell .htaccess to go back to html very stupid. no reason to rename to php just to use the files as normal html files, when there are no functionality html -> php -> html is this some kind of loop? lol
i'm pretty sure he was telling you how to set it up so that you're files are parsed as php but the urls do not change for the user....
I give up hahahahah. I want php scripts to run on a html page. I can't do this however because if I place php code in a html page it is not parsed due to restrictions palced by my host. However if my whole page is in .php then the php script on the page will work (AKA SUCCESS). I want to know, if I want to convert my index.html page to php, do I just change the extension and thats it and it will work? Or do i have to add other commands and such like echo or whatever the hell that is.
There are two solutions to this that I can think of. One would be to convert all pages to ".php" and setup 301 Redirects on your old ".html" pages to the php ones. The other would be to get a new host that lets you screw around with .htaccess.
Okay sweet thats what I was looking for, one more thing (Oh no). If its a new site do I still need to redirect (as in, do I still need the html page to redirect from?)
I had major issues with this as I wrote one of my sites in html then realized I needed to parse php in the html files after a couple of hours looking around for answers as I too use godaddy I contacted them and they enabled it for me they also gave me this to code to add to my .htaccess file You have to be aware of what version of php your database your site is using so 5 add a 5 or 4 add a 4 simnpole you can find that info in the Database cpanel. You als need to be on linux and running hosting config 2.0 alll this info you will find in your hosting cpanel https://hostingmanager.secureserver.net/AccountPanel.aspx #htaccess mod rewrite code Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / #AddType x-mapp-php4 .html .htm AddHandler x-httpd-php .html .htm .cgi .php If you unsure PM and ill arrange to send you my .htaccess file Hope this helps buddy!
Thank you very much for that code, I'm going to try it right now. One thing, do I have to ask Godaddy to enable it or will this code suppliment it?
Try the code see if it works bud if not ask godaddy like I did and they will enable it for you Best of luck m8y