Page 1 of 1

Redirecting from inner folder

Posted: Sat Oct 03, 2009 4:52 am
by sherone
Sorry for the newbie question.

I have created a website It includes more than 7000 pages and more than 200 inner folders.
I'm using simple including file(header.php, right.php, left.php, bottom.php, footer.php).
in all the 7000 pages bottom, right, left and footer.php is the same and I might update this part in future.

Now the problem is when I go to the inner folder I want to redirect the pages to root directory.
suppose I have folder named "A" and theres is some files like "file1.php", fle2.php.
I created the "file1.php" like this.

<?php
include("header.php");
include("left.php");
?>
Contents content content content

<?php
include("right.php");
include("footer.php");
?>

but when I click on the "aboutus" button in the "file1.php" its showing file not found. becuase my aboutus.php in the root directory not in the folder "A".

How will I solve this problem.

I want to use this redirection function all my 200 folders.

any advise suggestion would be appreciated.

Thanks
sherone

Re: Redirecting from inner folder

Posted: Sat Oct 03, 2009 8:40 am
by Darhazer
Add <base> tag in your header :D

Re: Redirecting from inner folder

Posted: Sat Oct 03, 2009 12:16 pm
by sherone
Can you clear it? how will add the base tag??

Re: Redirecting from inner folder

Posted: Sun Oct 04, 2009 5:22 am
by Darhazer
It's just an HTML tag:

Code: Select all

<base href="http://yourdomain.com" />
In this way all your relative links will be relative to yourdomain.com and not to the current path, as yourdomain.com/A/

Re: Redirecting from inner folder

Posted: Tue Oct 06, 2009 1:57 pm
by sherone
My applied this. but my style sheet not working with the base url tag.
Darhazer wrote:It's just an HTML tag:

Code: Select all

<base href="http://yourdomain.com" />
In this way all your relative links will be relative to yourdomain.com and not to the current path, as yourdomain.com/A/