0

I was wondering how you could make it so that "website.com" has an index.php file that simply opens "website.com/home" but without changing the URL. I originally had it so that it used a PHP include of "website.com/home/index.php" inside "website.com/index.php" but when i had to use includes inside of "website.com/home/index.php" it stopped working as it was running the includes from "website.com/index.php" instead of "website.com/home/index.php" is there any way to simply send the file "website.com/home/index.php" and have it run from "website.com/home/index.php" without changing the URL? I would want to avoid having to use the absolute location to simplify it and so i can copy and paste the code into other directories without having to edit it accordingly.

1
  • Check out Apache's mod_rewrite. Commented Jul 18, 2012 at 1:54

1 Answer 1

1

Use chdir() to navigate to the correct folder, then include("index.php");

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.