473,395 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

the root folder

Hi,
I've a web site in the address http://mySite.com
in the root, I've a file index.html

I've some subfiolders insid root/sub1/sub2

I like to add an html file (or php) index.html that call the index.html of
the root (in order to protect)
Now I've created 2 different index.html because I use relative path to
design the root (../index.html and ../../index.html)

I like to have the same file in all folders,but I don't know how to call the
root folder.
Any help please?
Thanks
Jul 17 '05 #1
10 2739
"toufik toufik" <to*****@sympatico.ca> wrote in message
news:DE********************@news20.bellglobal.com. ..
Hi,
I've a web site in the address http://mySite.com
in the root, I've a file index.html

I've some subfiolders insid root/sub1/sub2

I like to add an html file (or php) index.html that call the index.html of
the root (in order to protect)
Now I've created 2 different index.html because I use relative path to
design the root (../index.html and ../../index.html)

I like to have the same file in all folders,but I don't know how to call the root folder.
Any help please?


Are you trying to include the file or create a link to it? That is quite
unclear.

- Virgil
Jul 17 '05 #2
Thanks.

I like to call the file:

<body onload="document.location.href='../../index.html';">

"Virgil Green" <vj*@obsydian.com> wrote in message
news:QS*******************@newssvr22.news.prodigy. com...
"toufik toufik" <to*****@sympatico.ca> wrote in message
news:DE********************@news20.bellglobal.com. ..
Hi,
I've a web site in the address http://mySite.com
in the root, I've a file index.html

I've some subfiolders insid root/sub1/sub2

I like to add an html file (or php) index.html that call the index.html of the root (in order to protect)
Now I've created 2 different index.html because I use relative path to
design the root (../index.html and ../../index.html)

I like to have the same file in all folders,but I don't know how to call

the
root folder.
Any help please?


Are you trying to include the file or create a link to it? That is quite
unclear.

- Virgil

Jul 17 '05 #3
"toufik toufik" <to*****@sympatico.ca> wrote in message
news:DE********************@news20.bellglobal.com. ..
Hi,
I've a web site in the address http://mySite.com
in the root, I've a file index.html

I've some subfiolders insid root/sub1/sub2

I like to add an html file (or php) index.html that call the index.html of
the root (in order to protect)
Now I've created 2 different index.html because I use relative path to
design the root (../index.html and ../../index.html)

I like to have the same file in all folders,but I don't know how to call the root folder.


If you want sub1/index.php and other subN/index.php to redirect to root, use
header function.

<?php
header("Location: http://mysite.com/index.html"); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>
Jul 17 '05 #4
Thanks.
I don't like to use http://mysite in my call, because I can install my
solution in differant location,
http://mysite1
http://mysite2......

And I like that the code works in all situations

Thanks.

"Pertti Kosunen" <pe************@kolumb.us.fi_invalid> wrote in message
news:c6**********@phys-news1.kolumbus.fi...
"toufik toufik" <to*****@sympatico.ca> wrote in message
news:DE********************@news20.bellglobal.com. ..
Hi,
I've a web site in the address http://mySite.com
in the root, I've a file index.html

I've some subfiolders insid root/sub1/sub2

I like to add an html file (or php) index.html that call the index.html of the root (in order to protect)
Now I've created 2 different index.html because I use relative path to
design the root (../index.html and ../../index.html)

I like to have the same file in all folders,but I don't know how to call the
root folder.


If you want sub1/index.php and other subN/index.php to redirect to root,

use header function.

<?php
header("Location: http://mysite.com/index.html"); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>

Jul 17 '05 #5
"toufik toufik" <to*****@sympatico.ca> wrote in message
news:8_********************@news20.bellglobal.com. ..
Thanks.

I like to call the file:

<body onload="document.location.href='../../index.html';">


You can always access the root index.html just by using "/index.html".

- Virgil
Jul 17 '05 #6
"toufik toufik" <to*****@sympatico.ca> wrote in message
news:l3********************@news20.bellglobal.com. ..
Thanks.
I don't like to use http://mysite in my call, because I can install my
solution in differant location,
http://mysite1
http://mysite2......

And I like that the code works in all situations


http://fi2.php.net/manual/en/function.header.php

You can use $_SERVER['HTTP_HOST'].

<?php
header("Location: http://" . $_SERVER['HTTP_HOST'] . "/");
?>
Jul 17 '05 #7
In article <l3********************@news20.bellglobal.com>,
"toufik toufik" <to*****@sympatico.ca> wrote:
Thanks.
I don't like to use http://mysite in my call, because I can install my
solution in differant location,
http://mysite1
http://mysite2......

And I like that the code works in all situations

Thanks.


Then you can do this:

header('Location: http://' . $_SERVER['HTTP_HOST'] . '/index.html');

JP

--
Sorry, <de*****@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
Jul 17 '05 #8
toufik toufik schrieb:
Hi,
I've a web site in the address http://mySite.com
in the root, I've a file index.html

I've some subfiolders insid root/sub1/sub2

I like to add an html file (or php) index.html that call the index.html of
the root (in order to protect)
Now I've created 2 different index.html because I use relative path to
design the root (../index.html and ../../index.html)

I like to have the same file in all folders,but I don't know how to call the
root folder.


You could do a redirect:

$domain=$_SERVER['HTTP_HOST'];
header("Location: http://$domain/index.html");

Or simply include it with this index.php:

<?php include('/index.html'); ?>

The second solution creates a problem with files included by the
index.html, because all the relative paths have changed. Any pictures or
JavaScripts have to be referenced by absolute URL. If this is OK for
you, use the include, because it should be a bit quicker.

AllOlli
Jul 17 '05 #9
"Oliver Grätz" <ol***********@gmx.de> wrote in message
news:40***********************@newsread4.arcor-online.net...
toufik toufik schrieb:
Hi,
I've a web site in the address http://mySite.com
in the root, I've a file index.html

I've some subfiolders insid root/sub1/sub2

I like to add an html file (or php) index.html that call the index.html of the root (in order to protect)
Now I've created 2 different index.html because I use relative path to
design the root (../index.html and ../../index.html)

I like to have the same file in all folders,but I don't know how to call the root folder.


You could do a redirect:

$domain=$_SERVER['HTTP_HOST'];
header("Location: http://$domain/index.html");

Or simply include it with this index.php:

<?php include('/index.html'); ?>


This most likely will *not* work as the include paths are system paths, not
paths from the webroot.

- Virgil
Jul 17 '05 #10
Virgil Green schrieb:
<?php include('/index.html'); ?>


This most likely will *not* work as the include paths are system paths, not
paths from the webroot.


Oh, total blackout on my side. Yes, it certainly won't work unless you
have your own server and use a chroot-environment like I do...

AllOLLi
Jul 17 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jerry | last post by:
I'm having just a bit of trouble wrapping my brain around the task of working with folders that are above the site's root folder. I let users upload photos (.jpg/.gif files) which can...
1
by: John Dalberg | last post by:
I have an asp.net app that is in a folder which is two levels under the website root folder. The website has a login.aspx which is in the root folder. How do I get the relative path to the web...
19
by: Steve Franks | last post by:
I am using VS.NET 2005 beta 2. When I run my project locally using the default ASP.NET Development Web Server it runs using a root address like this: http://localhost:11243/testsite/ However...
3
by: Nalaka | last post by:
Hi, I have an asp.net web application (www.myWebSite), and a subweb application (www.myWebSite/subSite). How do I set it so that, subweb application (www.myWebSite/subSite) be the root...
2
by: Jeff Brown | last post by:
Hi, I suspect that this isn't possible, but I figured I'd ask. My project has a root namespace, let's say it's "Root", that applies to almost every source file (which is why I've set it as the...
0
by: Carl Gilbert | last post by:
Hi I am trying to get a simple ASP.NET web application to work on my 1&1 (1and1) web space. I managed to get something working a while ago, with thanks to Karl Seguin, but for some unknown...
2
by: news.sbcglobal.net | last post by:
I hope I can explain this well enough to understand. I have a master page that is used by almost all of the pages in my site. On the master page is a table. In one of the cells in this table, I...
2
by: Chris | last post by:
I have a web app which sit in a virtual but is a sub folder of the web tree. I thought if I put the web.config in the virtual it would read from there but it seems to only accept it if the...
3
by: Chris | last post by:
I have created a site with VS2005, using asp.net/c#. When I try to deploy this site to our intranet asp server all of my links that were "~/Folder/Site.aspx" no longer work because when I move it...
3
by: Rick | last post by:
Hi, Our website used to have all pages in the root folder, and the entry page is "Login.aspx". I was asked to move all pages inside a folder named "Aspx" Is it possible to move also the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.