Jump to content

Rewrite Rule - Change of path


Sirax

Recommended Posts

Dear all,I've got a little question. I have build a website with php navigation like this:

<?phpinclude_once"functions.php"; // security$paginas = array('home','producten','diensten','specialisatie','contact','login/index.php');$pagina = isset($_GET['p']) ? $_GET['p'] : "home";$pagina = in_array($pagina,$paginas) ? $pagina : "home";?><div id="navigation"><!--NAVIGATION STARTS-->  <ul>	<li><a href="?p=home" <?=$pagina=="home" ? "class='active'" : NULL?>>home</a></li>	<li><a href="?p=producten" <?=$pagina=="producten" ? "class='active'" : NULL?>>producten</a></li>	<li><a href="?p=diensten" <?=$pagina=="diensten" ? "class='active'" : NULL?>>diensten</a></li>	<li><a href="?p=specialisatie" <?=$pagina=="specialisatie" ? "class='active'" : NULL?>>specialisatie</a></li>	<li><a href="?p=contact" <?=$pagina=="contact" ? "class='active'" : NULL?>>contact</a></li>	<li><a href="login/?p=index" <?=$pagina=="index" ? "class='active'" : NULL?>>login</a></li>	<li><a href="#" style="width:2px;cursor:default"></a></li>  </ul></div><!--NAVIGATION ENDS--><div id="container"><!--CONTAINER STARTS--><?phpinclude_once"pages/".$pagina.".php";?>

But when I use this, the link in the adress bar is like this...http://www.****.be/?p=specialisatie or http://www.****.be/?p=producten&product=versterktesluitplatenBut I would like to have the link in the adress bar like this:http://www.****.be/specialisatie/Thats nicer to see in stead of the ?p= things.Someone told me I have to use .htaccess with some code in it, does anyone know what exact code I need to fix this for my site?Thx in advance,Greets

Link to comment
Share on other sites

Before you get discouraged by the incredibly dense document that Synook linked you to (it's not Synooks fault that it's dense; it's written for sys-ops) scroll to the bottom and look at the examples. Be aware that you need to know a little about regular expressions, and you will need to capture and back-reference the relevant parts of your URL. If you know nothing about regular expressions, then that is the first thing to learn about.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...