Php include () for navigation uses absolute paths, but then

In a global common file I do something like


define('APP_ROOT', dirname(__FILE__));
define('DIR_INCLUDES', APP_ROOT.DIRECTORY_SEPERATOR.'includes');
define('DIR_LIBS', APP_ROOT.DIRECTORY_SEPERATOR.'libs');

set_include_path(DIR_INCLUDES.PATH_SEPERATOR.DIR_LIBS.PATH_SEPERATOR.get_include_path());

Then each page includes that via a relative path, once thats called, can pretty much forget about needing paths in any other include()/require()s.

Hi guys.

I am a newbie here, and I am not familiar with php programing. Now I want to build a dynamic pages with index.php and php navigation, a smart navigation for SEO like this.
hxxp://mydomain.com/index.php
hxxp://mydomain.com/vietnam_tour/index.php
hxxp://mydomain.com/vietnam_tour/trekking_tour/sapa_trekking.php
something like that…

In the pass I used this:

<?php
if(!isset($_GET[‘page’])){
include “ps_vietnam_tour_operator_travel_agency_welcome_page.php”;
}
elseif(isset($_GET[‘page’])){
if(file_exists(“”.$_GET[‘page’].“.php”)){
include “”.$_GET[‘page’].“.php”;
}else{
echo"<h3>Your site was not found or under contruction</h3>
<p>Hit <i>back button</i> on your Browser to go back.";
}
}else{
include “ps_firstpage.php”;
}
?>
to call file *.php in directory.
But it’s not good for indexing in search engine, not friendly at all.
Someone knows how to build a smart navigation as I want and show me how to link to page (call pages), please post here.
Thanks man
Looking for good news from you my firends online.

If you are using Apache you may want to look into “mod_rewrite”.

Joe

mod_rewrite…?? CAn you give me the link to mod_rewrite? for a newbie like me it’s really hard …so please tell me details, post it here plz

There are some great solutions here to a problem that I have had before and worked around with absolute paths.

Will be looking into these

thanks

Hi, here is some more information about mod_rewrite:

http://httpd.apache.org/docs-2.0/misc/rewriteguide.html

thank you for posting …but it’s quite hard for me while reading mod_rewrite …i am a newbie. So anyone have php navigation with the structure same same with What I want please post it here.
thanks