Advertisement:

Try to remove index.php from your forum and redirect index.php to /

Aloittaja khoking, kesäkuu 03, 2007, 04:53:56 AP

« edellinen - seuraava »

khoking

Can someone guide me on how to:

Try to remove index.php from your forum and redirect index.php to /

?

Thanks.
Kho King
www.ShaShinKi.com
www.PentaxWorld.com

eRott

Ok, well, while i am not too sure where you want to redirect to or why or how, I will to my best to help out. Maybe if you described your situation a bit more, it would be easier.

I am assuming you do not want to use html to redirect so we will stick to PHP. There is generally one way to redirect, using the header location. Now, lets say you just simply want to redirect to lets say google. Open up index.php in your forum directory, delete all that code and replace it with:


<?php

header
("Location: http://www.google.com/"); //redirects your browser to google
exit; //this just basically ensures that no other scripts etc are running when you redirect to google

?>



Now, lets say you want your forums to still work and at the same time, redirect someone based upon some sort of information.

Lets say you want to redirect based upon if the user is for example an administrator, you would do something like:


<?php
if ($context['user']['admin'] {
header("Location: http://www.google.com/");
exit;
}
?>



I don't know, I cannot really answer your question unless you specify in greater detail, what you want to do.

khoking

Hi eRott,

Many thanks for replying.

Actually what I want is simple, I do not want users to see the index.php as in www.pentaxworld.com/forum/index.php, I want everything to be point to www.pentaxworld.com/forum.

Thanks.
Kho King
www.ShaShinKi.com
www.PentaxWorld.com

Green Beret

add this
require_once("forum/index.php");
and it should only show pentaxworld.com [nofollow] for the url??

Advertisement: