Jump to content

Writing a website


Recommended Posts

I was wondering, how do you code a website that has sections.

 

What I mean by sections is like this: http://www.helionet.org/index/index

 

I want to have a page that doesn't have to end in .html but still it should be a page.

 

I know I sound a bit confusing but if someone could help me I'd be grateful. :lol:

Link to comment
Share on other sites

I'm having a difficult time understanding your question completely. All files need to have an extension so that the server and browser know how to interpret that particular file. If you are talking about breaking your site down into an organized set of directories or folders then I've found it best to use relative paths rather than complete paths. Using relative paths make it easier to move things around and adjust as the site grows. If I didn't come close to answering your question, maybe you can give an example of what you are trying to do.

Link to comment
Share on other sites

I think Lilium is talking about how sometimes you can just punch in a directory i.e. foo.com/bar, and still get a html page. Or when you 404 on a site, they give you a customized 404 instead of your browser giving you the standard.

I've wondered about that myself, but I haven't tried out anything yet. I think if you put an index page in any directory, the browser will automatically go to that page, but the url display will only show the directory. It works in theory anyways.

Link to comment
Share on other sites

i believe i know what he means, and yes all files need to have an extension.

the only trick i can think of to bypass that would be when you first load into

a default page it only shows the directory... example: i have a main page w/

link that points to directory on the website say /games... in that directory

you have a default .aspx/.html/.whatever... when that default page loads

it would show this in the address bar: http://www.yourpage.com/games/

 

edit: lol and wizard beats me to it :-P

Link to comment
Share on other sites

Ahh yes, now I see what you are getting at. This is handled by the DirectoryIndex and DirectorySlash directive with Apache Module mod_dir. As Wizard and Sungazer stated there are defaults setup in the main configuration file that tell the server what files to look for when a directory is entered. You would need to ask Heliohost for the default settings. Normally it is index.html and index.html.var. I would venture to guess that this has been expanded to include index.htm, index.php, default.aspx and possibly a few others. Provided overrides are permitted in the main configuration you can add a .htaccess file with a directive to point to files other than the default configuration.

Link to comment
Share on other sites

Wow great replies guys! I've posted this same topic in other websites I've been and your replies have been most helpful! Thanks again! :D

Link to comment
Share on other sites

Look up mod_rewrite ;)

*pours over Apache documentation*

How would we utilize this? It looks like there are no config files for Apache in my /home.

 

>>The Wizard is Confounded.<<

 

Edit: Oh wait... is it through .htaccess? Means we have to make these ourselves.

Link to comment
Share on other sites

Yes, the .htaccess file allows you to customize your configuration by directory. Any directives that you place a .htaccess file will also apply to subdirectories of the directory it is placed in. In most cases the main configuration of apache is enough to satisfy your needs. .htaccess files come into play when you want to do something a little different.

Link to comment
Share on other sites

  • 2 weeks later...

In the case of helionet.org/index, that would simply be a sub-directory with an index.html, index.php or default.php file in it. If you want to make your website do this, simply create a directory for every page rather than a seperate HTML file. this would be the option, however it is very time consuming. I feel that the best and easiest way to design a fully functional website with seamless integration with services like openID, Windows Live and Facebook, you should look into an open source CMS (Content Management system) Called drupal.

 

http://drupal.org

 

It works like this. You upload the files to your website, extract them, and navigate to that directory. The system guides you through the installation and database setup, and gives you a feature to give every page a clean URL. A clean URL basically masks the extension and gets rid of any nasty ?a= variables.

 

Example:

www.example.com/?q=page/services&hl=en

Would turn out like this:

www.example.com/page/services/en

 

This gives the appearance of multiple directories when it is a single php file returning database fields to display the different content.

 

If you need any help,

or send me a message.

 

Look up mod_rewrite ;)

*pours over Apache documentation*

How would we utilize this? It looks like there are no config files for Apache in my /home.

 

>>The Wizard is Confounded.<<

 

Edit: Oh wait... is it through .htaccess? Means we have to make these ourselves.

 

There should already be a .htaccess in your public_html directory. Just make sure that you have enabled cpanel to show hidden files

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...