troubleshooting Question

htaccess url masking and php page

Avatar of JiveMedia
JiveMediaFlag for Australia asked on
PHPApache Web ServerMiscellaneous
2 Comments1 Solution388 ViewsLast Modified:
Hi,

Im new to htaccess and masking urls and would like a bit of help.
I have a index.php file that acts as a shell for the other pages on my website.
Inside the main content div in that page, i have made an array with the below php code so if i type in for example, "www.domain.com.au/index.php?ref=contact" that would take me to the contact page.

Now, i want it so if i type in "www.domain.com.au/contact" it would take me to the index page with the added contact page into the main div of index.php.

Could someone please help :) thanks.
<?php
$pagelist = array("home", "services", "contact");
if(in_array($_GET['ref'], $pagelist)) {
include($_GET['ref'].".php");
}
?>
ASKER CERTIFIED SOLUTION
David S.
Consultant & Challenge Subduer
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros