vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=313658

Editing .htaccess to use PHP inside of HTML?
by Brad Padgett
13 Aug 2014 02:49

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)

Lynne 13 Aug 2014 02:53

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.

Brad Padgett 13 Aug 2014 03:48

Quote:

Originally Posted by Lynne (Post 2511059)
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)

Lynne 13 Aug 2014 18:01

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).

Scanu 14 Aug 2014 09:32

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.


Brad Padgett 14 Aug 2014 10:44

Quote:

Originally Posted by Scanu (Post 2511224)
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.

Scanu 14 Aug 2014 10:59

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

Brad Padgett 14 Aug 2014 11:09

Quote:

Originally Posted by Scanu (Post 2511248)
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.

Lynne 14 Aug 2014 17:05

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.

Brad Padgett 15 Aug 2014 02:09

Quote:

Originally Posted by Lynne (Post 2511288)
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.

Lynne 15 Aug 2014 03:05

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).


All times are GMT. The time now is 16:01.

Powered by vBulletin® Version 3.8.14
Copyright © 2020, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.