Making internal links output look like clean url's
Posted: Wed Jul 23, 2008 10:48 pm
Okay, This is my first post and basically I've searched for a couple of days now trying to solve this problem so I thought I would finally post my own topic.
Simply Is it even possible and if so How can one make internal links of a page that are dynamic produce output that is a clean url.
I've done mod_rewrite and am able to type in a clean url but as far as clicking on links and what is being viewed in the browser address bar, it's still dynamic ugly looking urls.
The website I'm working on is http://www.aceokayama.com
if you type in something like http://www.aceokayama.com/about.html it goes to my site which is really
http://www.aceokayama.com/index.php?theXML=about.xml
I'm using a main index.php page to channel a bunch of different html and php pages through simple xml. It works and is cool (I think) but I want clean url's.
Can anyone help?
Code that might be useful is
first the index.php
and second like for instance if $xml pulled up about_navbar.html it looks like this
All pages come from an .xml page like this
I'm using php 5.2.6 and apache 2.2.9 (Unix)
Any help would make my day
Thanks
Simply Is it even possible and if so How can one make internal links of a page that are dynamic produce output that is a clean url.
I've done mod_rewrite and am able to type in a clean url but as far as clicking on links and what is being viewed in the browser address bar, it's still dynamic ugly looking urls.
The website I'm working on is http://www.aceokayama.com
if you type in something like http://www.aceokayama.com/about.html it goes to my site which is really
http://www.aceokayama.com/index.php?theXML=about.xml
I'm using a main index.php page to channel a bunch of different html and php pages through simple xml. It works and is cool (I think) but I want clean url's.
Can anyone help?
Code that might be useful is
first the index.php
Code: Select all
<?php
//Xace
//XML-Based Simple CMS system
//ACE English Website
// NOTE: Requires simpleXML extensions in PHP 5.0!
//get an XML file or load a default
if (isset($_REQUEST["theXML"]) && $_REQUEST["theXML"] != "") {
$theXML = $_REQUEST["theXML"];
} else {
$theXML = "ace.xml";
}
//Open up XML file
@$xml = simplexml_load_file($theXML);
if ( !$xml){
print ("there was a problem opening the XML");
} else {
$xml = simplexml_load_file($theXML);
/*Start the head of the html*/
include ($xml->top);
include($xml->css);
echo"</head>\n";
/*Start the body of the html*/
echo"<body>\n";
include ($xml->wrapper);
echo"<div id=\"header\">\n";
include ($xml->navbar);
echo"</div>";
echo"<div id=\"sidebar\">\n";
@include ($xml->sideNav);
echo"</div>";
echo"<div id=\"secondary\">\n";
@include ($xml->secondary);
echo"</div>";
echo"<div id=\"main\">";
include ($xml->main);
echo"</div>";
echo"<div id=\"footer\">\n";
include ($xml->footer);
echo"</div>\n";
echo"</div>\n";
include ($xml->bottom);
/*end of the html*/
}
?>
Code: Select all
<div id="logo"><img src="Web/catlogo.png" width="200" height="120"/></div>
<div id="banner"><img src="Web/bannerAce.gif" width="820" height="100"/></div>
<ul>
<li><a href="index.php?theXML=ace.xml">Home</a></li>
<li id="current"><a href="index.php?theXML=about.xml">About Us</a></li>
<li><a href="index.php?theXML=school.xml">Schools</a></li>
<li><a href="index.php?theXML=recruitment.xml">Recruitment</a></li>
<li><a href="index.php?theXML=contact.xml">Contact</a></li>
</ul>
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<cpage>
<top>html_pages/about_top.html</top>
<css>html_pages/style.html</css>
<wrapper>html_pages/wrapper.html</wrapper>
<navbar>html_pages/about_navbar.html</navbar>
<sideNav>html_pages/about_sideNav.html</sideNav>
<secondary>html_pages/about_secondary.html</secondary>
<main>html_pages/about_main.html</main>
<footer>html_pages/footer.html</footer>
<bottom>html_pages/bottom.html</bottom>
</cpage>
Any help would make my day
Thanks