JiveMedia
asked on
htaccess url masking and php page
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Got it working, however i had to change the 2 RewriteCond's to;
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
so it would load my css and images files.