Page 1 of 1

Nice URL's problem

Posted: Tue Jul 27, 2010 2:31 am
by ellesgaard
Hi there.
I have a problem, with my nice URL script.
It kind of works. The address 'muoa2/account' works fine, but if I add a / to end like 'muoa2/account/' or 'muoa2/account/5', my css disapears :?

The .htaccess code:

Code: Select all

Options +FollowSymLinks  
RewriteEngine On  
  
RewriteCond %{SCRIPT_FILENAME} !-d  
RewriteCond %{SCRIPT_FILENAME} !-f  
  
RewriteRule ^.*$ ./index.php
And my index.php code:

Code: Select all

$request  = str_replace("/muoa2/", "", $_SERVER['REQUEST_URI']); 
$params     = split("/", $request);

$design = "design1";

$mappe = "dash/";
$side = "index";

if ($params[1] !=""){
	$side = $params[1];
}
if ($params[0] !=""){
	$mappe = $params[0] . "/";
}

#echo $mappe;
#echo "<br>pages/" . $mappe . $side . ".php";

$page_content = file_get_contents("design/". $design . "/main.html");
$page_content = str_replace("!!HEADER!!", file_get_contents("design/" . $design . "/header.php"),$page_content);
$page_content = str_replace("!!MENU!!", file_get_contents("design/" . $design . "/left_column.php"),$page_content);
$page_content = str_replace("!!FOOTER!!", file_get_contents("design/" . $design . "/footer.php"),$page_content); 

if (file_exists("pages/" . $mappe . $side . ".php")) {
	$page_content = str_replace("!!INDHOLD!!", file_get_contents("pages/" . $mappe . $side . ".php"),$page_content);
} else {
	echo "404";
}

echo $page_content;
Anyone who can help with an idea?

Re: Nice URL's problem

Posted: Tue Jul 27, 2010 2:54 am
by Benjamin
You can set the base url or use an absolute path to the css file.

Re: Nice URL's problem

Posted: Tue Jul 27, 2010 3:26 am
by ellesgaard
Thanks that solve the problem. :D