The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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) |
#2
|
||||
|
||||
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. |
#3
|
||||
|
||||
Quote:
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) |
#4
|
||||
|
||||
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:
PHP Code:
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: Code:
AddType application/x-httpd-php .html |
#5
|
||||
|
||||
Lynne I think that the op doesn't know how to use html and php in a php file
Code:
This is your html code <?php echo 'This is your php code'; ?> This is other html code |
#6
|
||||
|
||||
Quote:
Like this: Code:
<?php echo '<p>text</p>'; echo '<h2>text</h2>'; ?> 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. |
#7
|
||||
|
||||
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 |
#8
|
||||
|
||||
Quote:
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. |
#9
|
||||
|
||||
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.
|
#10
|
||||
|
||||
Quote:
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. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|