Jump to content
The Uniform Server Community
Sign in to follow this  
NinthJake

Creating index folders?

Recommended Posts

So yeah, I need help with something here.

 

I have been using WAMP-Server some, and there you can just add a new folder to the "\www\" directory and it shows up on the index page.

 

But to do that on Uniserver it seems that you have to edit the ".htaccess" file or something right? And I have no clue whatsoever on what to edit :)

 

I want to have different websites in different folders on my index page. Can I get any help with that?

 

I run Uniform Server 5.5-Nano on Windows 7 OS if that is any help.

Share this post


Link to post
Share on other sites
I have been using WAMP-Server some, and there you can just add a new folder to the "\www\" directory and it shows up on the index page.

 

I want to have different websites in different folders on my index page. Can I get any help with that?

I am not sure if I understand the problem! However the following two options may be appropriate:

 

Option 1:

With the exception of file .htaccess delete all files and folders in folder UniServer\www

 

Now create folders to house your sites in folder UniServer\www

For example two sites fred1 and fred2 would give

UniServer\www\fred1

UniServer\www\fred2

 

Add your sites to these folders. (fred1 and fred2 are effectively your site root folders)

 

Start the servers type http://localhost/ displays an index page listing folders fred1 and fred2 these are links that will take you to your sites.

 

The above meets your requirements however is far from ideal

 

Option 2:

For this option I will assume a fresh install of Uniform Server.

 

Lets assume you have two domains fred1.net and fred2.com their corresponding sites will be saved in folders UniServer\www\fred1 and UniServer\www\fred2 respectively (folders can have any name you like).

 

1] Start servers

2] Run Apanel

3] Left menu, under Configurations click link "Admin Virtual Host"

4] Name text box enter: fred1.net

5] Path to DocumentRoot text box: This is automatically filled in with the path to folder www. At the end of this add folder fred1 will look similar to this:

C:/test/UniServer/www/fred1

6] Click Create Vhost (creates a Vhost entry in Apache’s configuration file and a new folder fred1 in folder C:/test/UniServer/www)

 

Repeat steps 3,4 and 5 for next site.

Note: Sites links are added to the top of this page after restarting servers you can use these to view your sites.

 

However when the servers are started you want an index page with site links.

Create a new file named index.html in folder UniServer\www with the following content:

 

Index

Index

fred1

 

fred2

 

 

Copy or create your sits in folders fred1 and fred2

 

Restart servers and check index page links functions.

 

Additional information can be found on the Wiki:

Virtual Hosting: Name based

 

If you want a fully portable version check out this page:

 

UniServer USB: UniServer USB V55

 

All the best

Ric :)

Share this post


Link to post
Share on other sites

I base your answer on that you think that I own domains for the websites correct?

 

I do not own any domain yet. The "websites" I spoke about is just the html, css (etc etc) files that I want to host in different folders for easy accessing. Sorry about the misunderstanding :)

 

What I want to do is to display a series of folders on the index page where the codes for my websites are stored. Kinda like this.

IndexExample1.jpg

(Is it ok to have my custom logo display at the top by the way?)

 

I think that I have to code this in the index.php file but I am not sure (and I suck at PHP lol)

 

Any other solution?

And thank you for that portable version :)

 

I just thought that I would mention that when you click the tray icon and choose "WWW Root" it takes you to the index page in your browser instead of opening the folder :)

Share this post


Link to post
Share on other sites
I think that I have to code this in the file but I am not sure (and I suck at PHP lol)

To achieve what you want requires no PHP coding just standard links

 

I will assume:

1] The folder-image you are using is named folder.gif and you have placed it in folder UniServer\www\images

2] Also you have created three folders for your sites

UniServer\www\site1

UniServer\www\site2

UniServer\www\site3

 

Edit file UniServer\www\index.php

Just above this line:

The Uniform Server is a WAMP package…….

 

Add the following code:

<br>
<div align="center">
<img src="images/folder.gif" align=ABSMIDDLE alt="site1" /><a href="site1/"> Site1 </a>
<img src="images/folder.gif" align=ABSMIDDLE alt="site2" /><a href="site2/"> Site2 </a>
<img src="images/folder.gif" align=ABSMIDDLE alt="site3" /><a href="site3/"> Site3 </a>
</div>
<br>

Each link points to a site folder. When clicked looks for a index page in the following order index.html index.shtml index.html.var index.htm index.php3 index.php index.pl index.cgi and displays the first one found.

I assume each of your sites will have either index.html or index.htm

 

Note:

If you do not wish to use UniServer\www\index.php you can create your own index.html file in folder UniServer\www this will override index.php

Include a block similar to the above to point to your three sites.

I just thought that I would mention that when you click the tray icon and choose "WWW Root" it takes you to the index page in your browser instead of opening the folder

This is correct operation; it opens an index page in root folder WWW (page displayed defined by order as explained above)

(Is it ok to have my custom logo display at the top by the way?)

Yes you can please read UniServer\docs\LICENSE.txt for restrictions.

 

All the best

Ric :)

Share this post


Link to post
Share on other sites

hi,

 

in index.php, paste :

<div id="directories">
<h3>Root Directories - Dossiers à la racine WWW</h3>
<?php
$rep=opendir('.');
$bAuMoinsUnRepertoire = false;
while ($file = readdir($rep)){
if($file != '..' && $file !='.' && $file !=''){ 
	if (is_dir($file)){
		$bAuMoinsUnRepertoire = true;
		print("<div class='directories'><a href='$file/' class='text1'>$file</a></div>");
	}
}
}
if ($bAuMoinsUnRepertoire == false) {
print("<div id='directories1'>-  No files  -</div>");
}
closedir($rep);
clearstatcache();
?>
</div>

 

and

<style type="text/css">
#directories {margin:3em auto; width:500px;}
#directories1 {margin:3em auto; width:500px; text-align:center;}
.directories {
display:block;
margin-left:			38px;
padding-left: 		32px;
	background-image: 	url(images/Websites.png);
	background-repeat: 	no-repeat;
	background-position: 	top left;
	background-color: 	inherit;
padding-bottom:		1em;
text-shadow: 2px 2px 3px #aaa;
}</style>

 

@++

Share this post


Link to post
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.

Loading...
Sign in to follow this  

×
×
  • Create New...