NinthJake Posted December 22, 2009 Report Share Posted December 22, 2009 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. Quote Link to comment Share on other sites More sharing options...
Ric Posted December 22, 2009 Report Share Posted December 22, 2009 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\wwwFor example two sites fred1 and fred2 would giveUniServer\www\fred1UniServer\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 servers2] Run Apanel3] Left menu, under Configurations click link "Admin Virtual Host"4] Name text box enter: fred1.net5] 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/fred16] 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 Indexfred1 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 bestRic Quote Link to comment Share on other sites More sharing options...
NinthJake Posted December 23, 2009 Author Report Share Posted December 23, 2009 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.(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 Quote Link to comment Share on other sites More sharing options...
Ric Posted December 23, 2009 Report Share Posted December 23, 2009 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\images2] Also you have created three folders for your sites UniServer\www\site1 UniServer\www\site2 UniServer\www\site3 Edit file UniServer\www\index.phpJust 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.phpInclude 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 folderThis 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 bestRic Quote Link to comment Share on other sites More sharing options...
NinthJake Posted December 23, 2009 Author Report Share Posted December 23, 2009 It worked Thank you Ric. You are awesome! Quote Link to comment Share on other sites More sharing options...
kris_fr Posted December 23, 2009 Report Share Posted December 23, 2009 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> @++ Quote Link to comment Share on other sites More sharing options...
NinthJake Posted December 24, 2009 Author Report Share Posted December 24, 2009 Thank you for the reply but this has already been solved Thank you anyway Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.