Reply
Make .html pages load like.php
Old 11-03-2009, 08:25 PM Make .html pages load like.php
Super Talker

Posts: 109
Name: Not Telling
Trades: 0
What do I add in .htaccess so .html pages can load exactly like .php pages?
__________________
MY MSN: Sith717@Hotmail.com
PHP, HTML, and CSS Coding, Logo and Web Design - Professionally done.
PM me anytime for HTML, PHP or web design help. I will be glad to help you out.
sith717 is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 11-03-2009, 08:37 PM Re: Make .html pages load like.php
orionoreo's Avatar
Ultra Talker

Posts: 261
Name: Jerry
Trades: 0
what do you mean "like" php? if you mean just the extension just name them all .php
orionoreo is offline
Reply With Quote
View Public Profile
 
Old 11-03-2009, 08:39 PM Re: Make .html pages load like.php
Super Talker

Posts: 109
Name: Not Telling
Trades: 0
Yes but I have many.

I want like the page if it has a php code in it, have the extention .html but still load php inside of it.

Do u understand what i mean?
__________________
MY MSN: Sith717@Hotmail.com
PHP, HTML, and CSS Coding, Logo and Web Design - Professionally done.
PM me anytime for HTML, PHP or web design help. I will be glad to help you out.
sith717 is offline
Reply With Quote
View Public Profile
 
Old 11-03-2009, 09:05 PM Re: Make .html pages load like.php
orionoreo's Avatar
Ultra Talker

Posts: 261
Name: Jerry
Trades: 0
yes then htaccess is your friend... but there's a bit of work you need to do.. first thing you need to do is have this in your htaccess

Code:
RewriteRule ^(.*)\.html$ $1.php [QSA,NC,L]
then you just have to change all your internal links to point to .html... now your actual .html pages will have to be named .php as well
orionoreo is offline
Reply With Quote
View Public Profile
 
Old 11-03-2009, 09:11 PM Re: Make .html pages load like.php
treyk4's Avatar
Skilled Talker

Posts: 80
Name: Trey
Trades: 0
Quote:
Originally Posted by sith717 View Post
Yes but I have many.
Couldn't you just do a batch rename?
__________________
Decatur-Austin Robotics Coalition (DARC) - http://darcrobotics.org
treyk4 is offline
Reply With Quote
View Public Profile
 
Old 11-03-2009, 10:07 PM Re: Make .html pages load like.php
Super Talker

Posts: 109
Name: Not Telling
Trades: 0
How do I do that? How do I batch rename?
__________________
MY MSN: Sith717@Hotmail.com
PHP, HTML, and CSS Coding, Logo and Web Design - Professionally done.
PM me anytime for HTML, PHP or web design help. I will be glad to help you out.
sith717 is offline
Reply With Quote
View Public Profile
 
Old 11-03-2009, 10:10 PM Re: Make .html pages load like.php
Super Talker

Posts: 109
Name: Not Telling
Trades: 0
Like on your site treyk4,

Your pages are like this:
http://darcrobotics.org/index.php?p=news

Thats exactly what i want, the pages to be like
http://mysite.org/index.php?p=contact
__________________
MY MSN: Sith717@Hotmail.com
PHP, HTML, and CSS Coding, Logo and Web Design - Professionally done.
PM me anytime for HTML, PHP or web design help. I will be glad to help you out.
sith717 is offline
Reply With Quote
View Public Profile
 
Old 11-04-2009, 02:20 AM Re: Make .html pages load like.php
rednimaT's Avatar
Skilled Talker

Posts: 65
Name: Taminder B.
Location: San Jose, CA
Trades: 0
make a file called .htaccess (no name, just extension) and place this inside:
Code:
AddType x-httpd-php .htm
__________________
NRG Lab - Web Design Services & Resources
(HTML/PHP/MySQL/JavaScript/AJAX/SEO)
rednimaT is offline
Reply With Quote
View Public Profile Visit rednimaT's homepage!
 
Old 11-04-2009, 08:32 AM Re: Make .html pages load like.php
King Spam Talker

Posts: 1,413
Trades: 0
Correct!

Change one line in the .htaccess file and be done with it, though I would use html and not htm.

Almost all servers allow html to be processed as php. If yours doesn't you might need a new host.
__________________
Colbyt
colbyt is online now
Reply With Quote
View Public Profile
 
Reply     « Reply to Make .html pages load like.php
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.13244 seconds with 13 queries