PHP Files and Webpages |
![]() ![]() |
PHP Files and Webpages |
![]()
Post
#1
|
|
![]() talent on another level ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 746 Joined: Oct 2006 Member No: 475,735 ![]() |
So I finished all the webpages for my website in Dreamweaver. All of them right now are saved as .htm files. I am using CuteNews, so would it be best to save them as .php files?
|
|
|
*mipadi* |
![]()
Post
#2
|
Guest ![]() |
Only if they're PHP files.
|
|
|
![]()
Post
#3
|
|
![]() talent on another level ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 746 Joined: Oct 2006 Member No: 475,735 ![]() |
what did you mean by that?
|
|
|
*mipadi* |
![]()
Post
#4
|
Guest ![]() |
Well, they should only have a .php extension if they are actually PHP scripts.
|
|
|
![]()
Post
#5
|
|
![]() talent on another level ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 746 Joined: Oct 2006 Member No: 475,735 ![]() |
well none of my .htm files have scripts on them. your gonna have to explain a little better, cause it doesnt make since right now what your saying? sorry
|
|
|
*mipadi* |
![]()
Post
#6
|
Guest ![]() |
A .php file is generally a webpage that mixes in at least a little PHP scripting. If your webpages don't use PHP, then they shouldn't be .php files.
|
|
|
![]()
Post
#7
|
|
![]() talent on another level ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 746 Joined: Oct 2006 Member No: 475,735 ![]() |
l0l okay gotcha. sorry bout the dumness. so if i saved them as .htm files, will it show when i click on one of my links. I want it to show as:
http://www.example.com/exits(no htm attached) |
|
|
*mipadi* |
![]()
Post
#8
|
Guest ![]() |
No, usually files that don't have an extension are directories. If you have a file at http://www.example.com/exists/index.html then you can reference it with http://www.example.com/exists.
|
|
|
![]()
Post
#9
|
|
![]() talent on another level ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 746 Joined: Oct 2006 Member No: 475,735 ![]() |
so basically save it as what, this: http://www.example.com/exists? but i still have to save it as a .htm or something and it would show the extension. Sorry I just want to make sure I have everything right
![]() |
|
|
*mipadi* |
![]()
Post
#10
|
Guest ![]() |
If a pathname doesn't have an extension, most browsers interpret it as a directory (or folder) name. So take this URL:
http://www.mydomain.com/mysite The name of the folder is mysite. Now, when a browser gets an address like that, it searches for a file in the folder mysite with the name index.{htm, html, asp, php, pl, ...}; if it doesn't find one with the basename index and an appropriate extension, it repeats the process with default.{htm, html, asp, php, pl, ...}. So in the case of the above URL, you are actually looking at a file named http://www.mydomain.com/mysite/index.html. So if you want a page to load by going to http://too-fresh.net/general/domain/, then you have to place a file named index.html in all of those directories. And yes, before some smart-ass can butt in, you can also accomplish this using Apache mod_rewrite rules, but that's too advanced for this situation. |
|
|
![]()
Post
#11
|
|
![]() talent on another level ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 746 Joined: Oct 2006 Member No: 475,735 ![]() |
okay, l0l at the last comment. i get all that now, so basically name one of my links index.html?
|
|
|
*mipadi* |
![]()
Post
#12
|
Guest ![]() |
|
|
|
![]()
Post
#13
|
|
![]() talent on another level ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 746 Joined: Oct 2006 Member No: 475,735 ![]() |
okay whoo! thanks, so i'ma name my blog link "index.html" right?
|
|
|
*mipadi* |
![]()
Post
#14
|
Guest ![]() |
Yeah.
|
|
|
![]()
Post
#15
|
|
![]() talent on another level ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 746 Joined: Oct 2006 Member No: 475,735 ![]() |
YES! Thanks again
![]() |
|
|
*mipadi* |
![]()
Post
#16
|
Guest ![]() |
Then just put a file called index.htm at the root of your server (probably in a folder called public_html).
|
|
|
![]()
Post
#17
|
|
![]() talent on another level ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 746 Joined: Oct 2006 Member No: 475,735 ![]() |
so could i put it for example in my cutenews/example folder or make a seperate folder for it? Where is the root server cause I don't have a host yet to upload to, so I just wanted to know where it is ahead of time?
|
|
|
*mipadi* |
![]()
Post
#18
|
Guest ![]() |
so could i put it for example in my cutenews/example folder or make a seperate folder for it? Where is the root server cause I don't have a host yet to upload to, so I just wanted to know where it is ahead of time? The directory of your server is just the first directory, the place where you put everything. Basically, anytime you want to just type a URL without a filename, you have to put a file called index.html in that directory. |
|
|
![]()
Post
#19
|
|
![]() talent on another level ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 746 Joined: Oct 2006 Member No: 475,735 ![]() |
okay I did that. I also made my blog link index.php cause that's where I will put cutenews. is that okay?
|
|
|
*mipadi* |
![]()
Post
#20
|
Guest ![]() |
Sounds good to me.
|
|
|
![]()
Post
#21
|
|
![]() talent on another level ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 746 Joined: Oct 2006 Member No: 475,735 ![]() |
okay i got it, thanks
|
|
|
![]() ![]() |