Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 13 Aug 2014, 02:49
Brad Padgett Brad Padgett is offline
 
Join Date: Jul 2014
Editing .htaccess to use PHP inside of HTML?

I am hosting with Godaddy.

I need the correct coding to edit .htaccess for running PHP code inside of an HTML file (my homepage for instance).

For example, "AddType application" does not work.

Neither did "FCGIdWrapper" or "AddHandler" but I may have used the wrong variation.

I'm sure many of you have had to set this up at some point or another so the correct code for Apache 2.5 is highly appreciated.

Thank you so much.

- Bradley Padgett (thexboxcloud)
Reply With Quote
  #2  
Old 13 Aug 2014, 02:53
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Why not just set the homepage as index.php instead of index.html?

I'm not sure if a lot of people have had to set up what you want as most would just set index.php as the default.

I don't know the .htaccess to do what you want, sorry.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #3  
Old 13 Aug 2014, 03:48
Brad Padgett Brad Padgett is offline
 
Join Date: Jul 2014
Originally Posted by Lynne View Post
Why not just set the homepage as index.php instead of index.html?

I'm not sure if a lot of people have had to set up what you want as most would just set index.php as the default.

I don't know the .htaccess to do what you want, sorry.
If this happens to be Lynne Sands then I am in the right place. And thanks for directing me to vBulletin.org

I may name my vBulletin home page index.php but I also need to know for wordpress for a separate site I am working on for a buddy.

If I was to name it index.php as I have tried, the html code does not take affect. This is possible if you were to explain how I am supposed to get the page to work properly?

To save trouble, the correct .htaccess lines for Apache 2.5 would be perfect.

But if you have a real suggestion that may assist in my (even) creation of the homepage using index.php then I'm all ears. I am experienced in html and css but I haven't got started with my php schooling quite yet.

I will wait on your response.

Thank you a lot.

- Bradley Padgett (thexboxcloud)
Reply With Quote
  #4  
Old 13 Aug 2014, 18:01
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
If you have a file called index.html and you want to show it in index.php, I think your index.php file can just look like this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

(I haven't tried that, but I think it would work.)

As I said before, I've never done what you want to do, but I did google it and found this - http://php.about.com/od/advancedphp/p/html_php.htm According to that, the line to add to your .htaccess file is:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

If that doesn't work, then are you sure your .htaccess file is working? Your host could have the server set up to not allow .htaccess files (they may have AllowOverride set to None instead of All).
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #5  
Old 14 Aug 2014, 09:32
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Lynne I think that the op doesn't know how to use html and php in a php file


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #6  
Old 14 Aug 2014, 10:44
Brad Padgett Brad Padgett is offline
 
Join Date: Jul 2014
Originally Posted by Scanu View Post
Lynne I think that the op doesn't know how to use html and php in a php file


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
From reading I have heard of a similar method with doing the same thing inside of html files.

Like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I intend to name my vBulletin homepage index.php

There are a couple other things I need to use the php for so I'm working with godaddy support right now to figure out how I'm going to get .htaccess to work on apache 2.5

I believe the php handler is FCGI. The support I've received with my webhost so far hasn't been of much help.

The link Lynne gave me is more directed towards another version of apache.

I've tried the method of using FCGIdWrapper and AddHandler. Still nothing.

A solution would evidently be impressive.
Reply With Quote
  #7  
Old 14 Aug 2014, 10:59
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
I'm still not sure why you don't want to use a .php file
In a .php file you can use html and php at the same time, why would you need to use php file in a .html file? I'm sorry but i don't fully understand what do you want
Reply With Quote
  #8  
Old 14 Aug 2014, 11:09
Brad Padgett Brad Padgett is offline
 
Join Date: Jul 2014
Originally Posted by Scanu View Post
I'm still not sure why you don't want to use a .php file
In a .php file you can use html and php at the same time, why would you need to use php file in a .html file? I'm sorry but i don't fully understand what do you want
The reason is I have another project going on.

I am designing a wordpress blog to implement a live feed and recent posts widget while still maintaining my index.html as this is all it's going to be.

I've made what I need to get done as clear as possible.

And please don't say I shouldn't ask here because it has to do with wordpress. I am confident it shouldn't matter. Really, I need to know for the purpose of using it anywhere but I could use the info for vBulletin too.

Apache 2.5 > .htaccess > lines for php inside of html

Pretty simple from there. I'll be checking back and forth so if anyone is used to .htaccess on sites like godaddy let me know. It's really been a pain.
Reply With Quote
  #9  
Old 14 Aug 2014, 17:05
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Have you asked GoDaddy if you can use .htaccess on your site? Like I said previously, if .htaccess doesn't seem to be working, then they may have AllowOverride set to None instead of All.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #10  
Old 15 Aug 2014, 02:09
Brad Padgett Brad Padgett is offline
 
Join Date: Jul 2014
Originally Posted by Lynne View Post
Have you asked GoDaddy if you can use .htaccess on your site? Like I said previously, if .htaccess doesn't seem to be working, then they may have AllowOverride set to None instead of All.
Yes, they said it was working.

I'm going to have to start using .php

So I'm going to have to learn how to do this. Apparently the method the other guy suggested is not working. I'll figure this out somehow.
Reply With Quote
  #11  
Old 15 Aug 2014, 03:05
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
If you post your code (if it's a bunch of html, then just the first and last few lines before your php code), then perhaps we can help. And, if you can provide us a link to view the problem, that helps (just put a page on your site called "test" with the content and link us to it).
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 07:51.

Layout Options | Width: Wide Color: